function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SørenKrabbeSørenKrabbe 

Render e-mail template without sending e-mail message

Hi,

 

In Apex when I'm sending an e-mail message I can define an e-mail template to use for the message. However, I'd like to know the value of the HtmlBody and PlainTextBody fields after the template has been applied but before the e-mail is sent off.

 

What I'm looking for is similar to the way the standard sent e-mail UI is working (user selects e-mail template to use, then edits the generated content, and then sends off the e-mail by clicking send). I seem to miss an email.prepare() method.

 

Any thoughts on how to achieve this?

 

Thanks