Loading
The Trailblazer Community is now read-only Read More
EmailQueueProcessor Interface

EmailQueueProcessor Interface

The EmailQueueProcessor interface handles email operations for a third-party email service, including sending emails and updating the tracking status in Salesforce. You can add additional implementations for different email service providers.

Required Editions

Available in: Lightning Experience
Available in: Enterprise and Unlimited Editions with Life Sciences Cloud, Life Sciences Cloud for Customer Engagement Add-on license, and the Life Sciences Customer Engagement managed package.

Namespace

lsc4ce

Typed

Strongly typed

Signature

Access Signature
global
void initialize(List<LifeScienceEmail> records);
global
void setParameters(Map<String, Object> params);
global
Boolean addMessage(LifeScienceEmail lScEmail);
global
Boolean exceededLimits();
global
Boolean canExceedLimits(Integer emails);
global
List<String> sendEmail();
global
void cleanUp(List<LifeScienceEmail> records);
global
List<LifeScienceEmail> updateAttemptStatus(List<LifeScienceEmail> emailAttemptsToProcess);
global
void finish();

Methods

Method Description
initialize(List<LifeScienceEmail> records) Initializes resources and setup for the third-party email service and prepares to process Life Science Email records.
setParameters(Map<String, Object> parameters) Configures required parameters for the email processor, and stores API credentials, configuration, and connection parameters.
addMessage(LifeScienceEmail lScEmail) Converts a Life Science Email record to the third-party service’s format and validates the email before adding it to the queue. Returns true if successful.
exceededLimits() Checks if the current email batch size will exceed limits for the third-party service. Returns true if the batch size will exceed limits.
canExceedLimits(Integer emails) Checks if sending the specified number of emails will exceed email sending limits. Returns true if sending will exceed limits.
sendEmail() Send the queued emails through the third-party service and return a list of error messages. Returns a null value if the email is sent successfully.
cleanUp(List<LifeScienceEmail> emails) Updates the status of processed Life Science Email records.
updateAttemptStatus(List<LifeScienceEmail> emailAttemptsToProcess) Updates Life Science Email records with the status of email attempts from the third-party service.
finish() Closes the connection to the third-party email service.

Example Implementation

See EmailQueueProcessor Example.

 
Loading
Salesforce Help | Article