Using Email Template in Apex! — Sarah on Salesforce


A method that makes apex and email templates work together! Found here: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_email_outbound_messaging.htm For the email template, I used a custom HTML template and filled it in with HTML and any merge fields for my custom object. renderStoredEmailTemplate(templateId, whoId, whatId) Example Usage: Messaging.SingleEmailMessage email = Messaging.renderStoredEmailTemplate(’00XR0000000AAAA’, null, ‘a0AR000000GAAAA’); system.debug( email.getHTMLBody()); The above will result in getting […]

via Using Email Template in Apex! — Sarah on Salesforce

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s