Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduced SingleEmailMessage limit usage #570

Merged
merged 8 commits into from
Oct 15, 2023

Conversation

jongpie
Copy link
Owner

@jongpie jongpie commented Oct 12, 2023

LoggerEmailSender Changes

  • Fixed Logger Error Emails eat up Single Email limit #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

@jongpie jongpie added Type: Bug Something isn't working Layer: Logger Engine Items related to the core logging engine Feature: Email Notifications labels Oct 12, 2023
@jongpie jongpie had a problem deploying to Experience Cloud Scratch Org October 12, 2023 02:51 — with GitHub Actions Failure
@jongpie jongpie force-pushed the bugfix/reduce-single-email-message-limit-usage branch from 7528d08 to 3b61e28 Compare October 12, 2023 03:09
@jongpie jongpie temporarily deployed to Base Scratch Org October 12, 2023 03:16 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Experience Cloud Scratch Org October 12, 2023 03:16 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Demo Org October 12, 2023 03:28 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Demo Org October 12, 2023 03:42 — with GitHub Actions Inactive
@jongpie jongpie force-pushed the bugfix/reduce-single-email-message-limit-usage branch from 2117538 to 1bffa6b Compare October 13, 2023 01:54
@jongpie jongpie temporarily deployed to Base Scratch Org October 13, 2023 01:57 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Experience Cloud Scratch Org October 13, 2023 01:57 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Base Scratch Org October 13, 2023 02:31 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Experience Cloud Scratch Org October 13, 2023 02:31 — with GitHub Actions Inactive
…fore generating package versions, because they upset the sf cli ᕕ( ᐛ )ᕗ
@jongpie jongpie temporarily deployed to Base Scratch Org October 13, 2023 02:55 — with GitHub Actions Inactive
@jongpie jongpie temporarily deployed to Experience Cloud Scratch Org October 13, 2023 02:55 — with GitHub Actions Inactive
…lly generated new package version due to issues in the pipeline
@jongpie jongpie marked this pull request as ready for review October 13, 2023 04:18
@codecov
Copy link

codecov bot commented Oct 15, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Files Coverage Δ
...ain/logger-engine/classes/LogEntryEventBuilder.cls 94.64% <ø> (ø)
...-logger/core/main/logger-engine/classes/Logger.cls 96.38% <ø> (ø)
.../main/log-management/classes/LoggerEmailSender.cls 96.55% <95.45%> (+3.21%) ⬆️

📢 Thoughts on this report? Let us know!.

@jongpie jongpie merged commit 77fe275 into main Oct 15, 2023
1 check passed
@jongpie jongpie deleted the bugfix/reduce-single-email-message-limit-usage branch October 15, 2023 01:47
@jongpie jongpie added the Layer: Log Management Items related to the custom objects & Logger Console app label Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Email Notifications Layer: Log Management Items related to the custom objects & Logger Console app Layer: Logger Engine Items related to the core logging engine Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logger Error Emails eat up Single Email limit
1 participant