Assuming that the "Person" object in your code refers to the contact to whom you are addressing the email, you can use the following code to achieve the desired result:
Hello {{Person.salutationPrefix}} {{Person.firstName}} {{Person.lastName}}
The "salutationPrefix" field should contain the title or salutation you want to include in the greeting. If you have translated versions of the salutation stored in your CRM system, you can use the "translate" function to retrieve the appropriate version for the contact's language preference.
Here is an example:
Hello {{translate Person.salutationPrefix field='salutationPrefix' scope='Contact' language=Contact.preferredLanguage}} {{Person.firstName}} {{Person.lastName}}
This code will look up the translated version of the salutation prefix in the language specified by the contact's "preferredLanguage" field. If the translation is not available, the default value in the "salutationPrefix" field will be used instead.
When using the code to retrieve the salutation prefix for an email template, it's important to keep in mind any data collection that may be involved. For example, if you're using a CRM system to store contact information, you may be collecting data on the contact's preferred language, which can be used to retrieve the appropriate translation of the salutation prefix.
I hope this helps! Let me know if you have any further questions.
Announcement
Collapse
No announcement yet.
Translate Contact Salutation Name/Title in Email Template
Collapse
X
-
Originally posted by lazovic View PostHi shef,
Try use the following lines:
Code:{{#ifEqual salutationName 'Mr'}}your translation{{/ifEqual}} {{#ifEqual salutationName 'Mrs'}}your translation{{/ifEqual}}
Here it is important to understand why we are using salutationName and not Person.salutationName.
When we select the Parent when forming an email, the attributes from the Email Template are already oriented towards the Parent, that is, as happens when working with the PDF Template, which always focuses on only one Target Entity and uses simple attributes, without preliminary inserts such as Person, User, etc. .
Leave a comment:
-
Hi shef,
Try use the following lines:
Code:{{#ifEqual salutationName 'Mr'}}your translation{{/ifEqual}} {{#ifEqual salutationName 'Mrs'}}your translation{{/ifEqual}}
Here it is important to understand why we are using salutationName and not Person.salutationName.
When we select the Parent when forming an email, the attributes from the Email Template are already oriented towards the Parent, that is, as happens when working with the PDF Template, which always focuses on only one Target Entity and uses simple attributes, without preliminary inserts such as Person, User, etc. .
Leave a comment:
-
Originally posted by shalmaxb View PostIt works in email template this way (without formula):
{{#ifEqual Person.salutationName Mr.}}your translation{{/ifEqual}}
{{#ifEqual Person.salutationName Mrs.}}your translation{{/ifEqual}}
I also tried with these:
Code:{{#ifEqual Person.salutationName 'Mr.'}}your translation{{/ifEqual}} {{#ifEqual Person.salutationName 'Mrs.'}}your translation{{/ifEqual}}
Code:{{#ifEqual Person.salutationName 'Mr'}}your translation{{/ifEqual}} {{#ifEqual Person.salutationName 'Mrs'}}your translation{{/ifEqual}}
It doesn't work either. It does not output anything when the template is loaded.
I also tried to match without the dot:
Code:{{#ifEqual Person.salutationName Mr}}your translation{{/ifEqual}} {{#ifEqual Person.salutationName Mrs}}your translation{{/ifEqual}}
However, while this solution might be a quick workaround, it is bound to fail. It assumes the language for the current user interface is set to English. If the current user interface will be set to another language, the ifEqual will not match. The absolute correct way to achieve this would be to output the choice of the salutation option according to the translation on the specific language.1 PhotoLast edited by shef; 04-03-2023, 12:58 PM.
Leave a comment:
-
It works in email template this way (without formula):
{{#ifEqual Person.salutationName Mr.}}your translation{{/ifEqual}}
{{#ifEqual Person.salutationName Mrs.}}your translation{{/ifEqual}}
Leave a comment:
-
Originally posted by shalmaxb View PostYou could achieve this by formula, but from your question it is not quite clear, if you have anything written in the salutatioName-field. A formula would depend on this. And there might be more than one solution depending on how it works in the moment.
You can reproduce this if you create an email template and in there try to have the salutationName translated into another specific language, which is different from the language of the interface you are on.
I have attached two screenshots which show where I am trying to apply this translation and where it will be used.2 Photos
Leave a comment:
-
You could achieve this by formula, but from your question it is not quite clear, if you have anything written in the salutatioName-field. A formula would depend on this. And there might be more than one solution depending on how it works in the moment.
Leave a comment:
-
Translate Contact Salutation Name/Title in Email Template
Hello,
I would like to translate the salutation name/title within an email template for Contact.
I have tried these, but they don't work.
Code:{{translate Person.salutationName field='salutationName' scope='Contact' language='en_UK'}} {{translateOption Person.salutationName field='salutationName' scope='Contact' language='en_UK'}}
Hello Mr. John Smith
Does anyone have any idea how to achieve this?
Thanks.
Leave a comment: