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
adilraza shaikh 2adilraza shaikh 2 

Email Template Subject is not translated on actual Email

In visualforce email template we have translated the the email subject as

<messaging:emailTemplate recipientType="User" relatedToType="Contact" language="{!CASE(relatedTo.Applicant_Primary_Language__c,'Chinese','zh_CN','Portuguese','pt_BR','Korean','ko','Japanese','ja','Spanish','es','en_US')}" subject="{!$Label.PopUp_Finish_Later}">

Where we have already added translation for diffrent languages in custom label.

In email template preview translation is showinng correctly, Even if we send the email from activity history the translation is showing correctly.

but on actual email address when email is coming up it is shows the subject as follows

Sandbox: ????????????

Any Idea why this is happing OR it there any alternate way to translate the VF Email template so it should show the correct translation on actual email address

Ajay K DubediAjay K Dubedi
Hi adilraza,

I have understood your problem. I am trying to solve your issue.
Please use below piece of code-
 
<messaging:emailTemplate recipientType="Contact"
    relatedToType="Account"
    language="{!recipient.language__c}"
    subject="{!$Label.email_subject}"
    replyTo="cases@acme.nomail.com" >

    <messaging:htmlEmailBody >
    <html>
        <body>
        <p>{!$Label.email_greeting} {!recipient.name}--</p>
        <p>{!$Label.email_body}</p>
        </body>
    </html>

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Ajay Dubedi
www.ajaydubedi.com
adilraza shaikh 2adilraza shaikh 2

Hi Ajay,

Currently, Body part is getting tranlated properly. it is only issue with subject.

Thanks,
Adil

SalesforceDevNewbie022SalesforceDevNewbie022
did you get the solution?