Codementor Events

How to configure emails in user local language?

Published Jun 12, 2023Last updated Aug 23, 2023

We want to configure the email templates in Salesforce to send the email based on the region the user is sending from.

For example, lets say a User/Sales-rep who is from europian region want’s to send an email in French as he/she is belonging to France. Then the email triggered from that user should be sent in French language.

Similarly, if a user is belonging to Japan of Asia region then the user sending email should have the content in Japanese language.

This is handled by using the Classic Email templates in salesforce with few changes that we need to take care.

<messaging:emailTemplate subject="{!$Label.Email_download_subject}{!RelatedTo.Subject__c}"
 recipientType="User"
relatedToType="User"
language="{!RelatedTo.LocaleSidKey}">
<messaging:htmlEmailBody >
        <html>
        <body>
   <apex:outputtext value="{!$Label.download_salutation}" />
   <p>
   <apex:outputtext value="{!$Label.download_report_type}">
   <apex:param value="{!RelatedTo.Email_data_Template_Name__c}"/>
   </apex:outputtext>
   <br/>
   </p>
   </body>  
    </html>    
 </messaging:htmlEmailBody>       
</messaging:emailTemplate>

Peace ✌️

Coffee.jpg

Discover and read more posts from Sunil Kumar
get started