I’m trying to create a customizable signature by preferred language of the contact in the Design Manager. I’m using this code but it doesn’t work, can anyone help me
Hey @ERojas5,
do you mean the preffered language by the HubSpot user (your colleagues;the ones who got access to the portal) or the reciepient (CRM data)?
A few things:
- If you want to display the text based on the HubSpot users language, you’ll need to input the text into the placeholder field of a text field, create a translations of the module (right sidebar of the module) and change the placeholder value in each language. <-- Never done this, but technically I can imagine that it will work.
If you want to display the text based on the reciepients language it should work. - Values are case-sensitive. Just mentioning this because you got “english” lowercase and everything else is not.
- To see the outcome of if-statements with personalization tokens you have to preview the module on a page/post/email with a contact that has the property. This means: If you preview the page/post/email with a contact that has this property set to english, you will see the english translation. If you preview the same asset with a contact that has a different value in the property it should display it differently.
- You can seperate the logic from the layout to have it more maintainable. See example below
{% set idioma = contact.hs_language|default('english') %}
{% if idioma == "es" or idioma == "Spanish" %}
{% set greeting = "Saludos cordinales," %}
{% elif idioma == "it" or idioma == "Italian" %}
{% set greeting = "Cordiali saluti," %}
...
{% endif %}
...
<table style="font-family:Arial, font-size:14px">
<tr>
<td>{{ greeting }} </td>
</tr>
<tr>
<td>{{ contact.firstname }}</td>
</tr>
<tr>
<td>{{ idioma }}</td>
</tr>
</table>
best,
Anton
Hello @Anton,
I’d like to set this up so that the value of contact.hs_language is applied to the recipient of the email. Could you please confirm if this is the correct approach, or if there’s a recommended way to achieve this? Design Previewer | HubSpot - 3 June 2025 | Loom
Hey @ERojas5,
thanks for the video. It helps a lot understanding what you’re trying to achieve.
The language selector you’re using in the video is not connected to hs_language property.
To test it as a reciepient, you have to put the module into an email.
I recommend to simply create a new one and call it “Signature module test” or something you’ll know that it’s just a test mail.
Once you’ve created a new email, drag&drop the module somewhere, click on “preview and test” and select “preview as contact”.
Then select a contact you’d like to use for preview.
To see the different outputs, switch between contacts.
My recommendation: Create at least one test contact and change the languages in the property.
best,
Anton


