+ Start a Discussion
ambitious Bambitious B 

Visualforce Email Template

Hi,

We have created an visualforce email template,which has to translated based on Users language.Here is the code,but this didn't get translated when we change the language.Any suggestions plz?
<messaging:emailTemplate subject="Last Login" recipientType="User" relatedToType="User_Status__c" language="{!recipient.LanguageLocaleKey}">

<messaging:htmlEmailBody >
<html>
<body>

<p>Hello "{!recipient.name}",</p>
<p>You have not logged into Salesforce.com in last 15 days. Is something wrong? Is there something that we can help you with? </p>
<p>Please login to Salesforce.com and keep your account active.</p>

<p>Regards,</p>
<p>Salesforce Support Team</p>

</body>
</html>
</messaging:htmlEmailBody>


</messaging:emailTemplate>
Best Answer chosen by ambitious B
ambitious Bambitious B
i found solution 
<messaging:emailTemplate subject="15-Last Login into salesforce" recipientType="User" relatedToType="User_Status__c" language="{!recipient.Email_Language__c}">
<messaging:htmlEmailBody >

<html>
<body>
<p>{!$Label.Email_Greeting}{!recipient.name},</p>
<p>{!$Label.Email_Body}</p>
</body>
</html>

</messaging:htmlEmailBody>

</messaging:emailTemplate>

All Answers

SFDC_DevloperSFDC_Devloper
Hi,

  I hope below link help you!

   https://success.salesforce.com/answers?id=90630000000gyjTAAQ

  

Thanks,
Rockzz
ambitious Bambitious B
Tried using custom Label as below
<messaging:emailTemplate subject="15 Days of Salesforce.com Inactivity - Please Login" recipientType="User" relatedToType="User_Status__c" language="{!relatedTo.User__r.Email_Language__c}">
<messaging:plainTextEmailBody >
<apex:variable var="LastLogin15" value="{!$Label.LastLogin15}"/>
</messaging:plainTextEmailBody>
</messaging:emailTemplate>

Here "LastLogin15" is a customm Label which holds the email content. when tried with sending an test mail ,this doesn't fire any content..........................
I'm i going wrong....suggestions welcomed
ambitious Bambitious B
i found solution 
<messaging:emailTemplate subject="15-Last Login into salesforce" recipientType="User" relatedToType="User_Status__c" language="{!recipient.Email_Language__c}">
<messaging:htmlEmailBody >

<html>
<body>
<p>{!$Label.Email_Greeting}{!recipient.name},</p>
<p>{!$Label.Email_Body}</p>
</body>
</html>

</messaging:htmlEmailBody>

</messaging:emailTemplate>
This was selected as the best answer