Is there a way, using Apex, to trigger the rendering of a VisualForce email template and capture the result as a string?

This would be used to set the HTML Body of an email to be sent using an external service (HTTP call-out)

1 Answer 1


Yes -- this can be done with a clever solution from this SFSE wizard @PJC


Leverages the apex SavePoint and Rollback to trick SFDC into rendering and retrieving the rendered value


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .