Salesforce Fact #660 | renderStoredEmailTemplate

While sending email related to VF email template from apex code, the translation might not work correctly using Messaging.SingleEmailMessage. The email template contains multiple custom labels and translation are also added accordingly.

There is a method renderStoredEmailTemplate(templateId, WhoId, WhatId) of Messaging class which can render and translate the email data correctly corresponding to the intended language.

Calling this method consumes one SOQL query count.

Reference: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_classes_email_outbound_messaging.htm#apex_System_messaging_renderStoredEmailTemplate

Comments

Popular posts from this blog

Salesforce Fact #192 | Call batch apex from flow

Salesforce Fact #457 | Get current user role name in flow