Skip to content

Instantly share code, notes, and snippets.

@srujan21
Created January 8, 2020 17:06
Show Gist options
  • Save srujan21/ac740a601f0c9d50a157284c8b103b3c to your computer and use it in GitHub Desktop.
Save srujan21/ac740a601f0c9d50a157284c8b103b3c to your computer and use it in GitHub Desktop.
Merge record data in email template
public static string renderEmailTemp(Id objctId, List<String> bodies){
// Id of the sObject, list of Email template bodies
List<Messaging.RenderEmailTemplateBodyResult> renderEmailTemplateBodyRes= Messaging.renderEmailTemplate(null,objctId, bodies);
return renderEmailTemplateBodyRes[0].getMergedBody();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment