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
Harsh Vardhan Agrawal 6Harsh Vardhan Agrawal 6 

Custom Label translations

I have to send email to contacts from an APEX batch class using a Custom Email template.

I have a custom email template. I have created multiple custom labels to create the email template as ours is a multi country org.

The requirement is to acheive the ability to send email to Contacts based upon a custom field called language__c. I have translations in custom label for countries - German, English.

If the language__c has de - the German translation of email template should be sent to the contact.
If the language__c has en - the English translation of email template should be sent to the contact.

How can I map the custom label that I have created and its translations to the custom field language__c on Contact so that the system understands which contact should receive which language in the email.