Skip to content

Reduced SingleEmailMessage limit usage

Compare
Choose a tag to compare
@jongpie jongpie released this 15 Oct 02:22
· 59 commits to main since this release
77fe275

Core Unlocked Package Changes

LoggerEmailSender Changes

  • Fixed #369 by changing how failure emails are sent to the 'Apex Exception Email' recipients (shown in the screenshot below, configurable under Setup --> Apex Exception Email)
    • Previously, the user ID (ApexEmailNotification.UserId) of Salesforce users configured as recipients (labeled as '1' in the screenshot below) was passed to the instance method Messaging.SingleEmailMessage.setToAddresses(), resulting in the email counting as an email to an external email address, which has an org daily limit. You can check your org's limit using this Apex snippet: System.debug(OrgLimits.getMap().get('SingleEmail'));
    • Now, the user ID (ApexEmailNotification.UserId) is passed to the instance method Messaging.SingleEmailMessage.setTargetObjectId(). Using setTargetObjectId() to send emails to users does not count towards the org's daily limit
    • External email addresses (labeled as '2' in the screenshot below, configured under Setup --> Apex Exception Email) will still count towards the org's daily email limit

image

Installation Info

Core Unlocked Package - no namespace

Full Changelog: v4.11.10...v4.11.11