Error Email Handling
Salesforce sends notification emails about unhandled Apex exceptions and Flow errors. Breezz can receive these emails through an Email Service and store them as log records.
Because the Email Service address is unique to each org, the steps below must be completed manually in every org after installation.
Prerequisites
- The Breezz package is installed, including the
ErrorsEmailServiceApex class. - You have permission to configure Email Services and Apex Exception Email (System Administrator or equivalent).
- The user you choose as the Context User in Step 2 has access to the log object. Assign the Breezz Permission Set to this user.
Step 1: Create the Email Service
- Go to Salesforce Setup (gear icon).
- In the Quick Find box, search for and select Email Services.
- Click New Email Service.

- Fill in the following fields:
- Email Service Name:
ErrorsEmailService - Apex Class:
ErrorsEmailService - Accept Attachments: None
- Active: checked
- Over Email Rate Limit Action: Requeue Message (recommended)
- Error Routing Address: optional. This address is notified when a message cannot be processed.
- Email Service Name:
- Leave Accept Email From empty.
- Click Save.
ℹ️ Note: Salesforce system emails can come from different sender addresses. If your security policy requires you to restrict Accept Email From, check the actual sender of an exception email first.
Step 2: Create the Email Address

- On the Email Service page, in the Email Addresses section, click New Email Address

- Fill in the following fields:
- Email Address Name: a label for this address, visible only in Setup, e.g.
errors - Email Address: a local part of your choice, e.g.
errors - Active: checked
- Context User: a user with access to the log object
- Email Address Name: a label for this address, visible only in Setup, e.g.
- Click Save.

- Copy the generated address (
errors@<random>.apex.salesforce.com). You will need it in the next step.
⚠️ Important: The handler runs as the Context User. If this user is deactivated, the service stops working.
Step 3: Configure Apex Exception Email
- Go to Salesforce Setup (gear icon).
- In the Quick Find box, search for and select Apex Exception Email.

- Paste the address from Step 2 into External Email Addresses.
- Click Save.
Step 4: Enable Flow Error Emails
By default, Flow error emails are sent only to the user who last saved the Flow. To send them to the same recipients as Apex exceptions:
- Go to Salesforce Setup (gear icon).
- In the Quick Find box, search for and select Process Automation Settings.

- Set Send Process or Flow Error Email to to Apex Exception Email Recipients.
- Click Save.
Step 5: Verify the Configuration
- Trigger an unhandled error, for example:
- a failing Queueable, Batch, or
@futurejob, - a record-triggered Flow with an Apex action that throws an exception.
- a failing Queueable, Batch, or
- Wait for up to a few minutes.
- Check that a new log record was created with the correct source and filled fields (class or Flow name, error message, details).

If no log record appears, check the following:
- The Email Service and the Email Address are both active.
- The address in Apex Exception Email is correct.
- The Context User has access to the log object.
- Setup → Deliverability is set to All email.
Notes
- Only unhandled errors generate these emails. Errors caught in a
try/catchblock or handled by a Flow fault path do not. - Execute Anonymous errors thrown directly do not generate an email. The error must occur in an async context or a trigger.
- Sandbox refresh or new org: the Email Address must be generated again, because the address is unique per org. Repeat Step 2 and Step 3.