CMS Development

ERojas5
Participant

Create a customizable signature by language

SOLVE

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

ERojas5_0-1749109116746.png

 

0 Upvotes
1 Accepted solution
Anton
Solution
Thought Leader | Partner
Thought Leader | Partner

Create a customizable signature by language

SOLVE

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:

  1. 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.
  2. Values are case-sensitive. Just mentioning this because you got "english" lowercase and everything else is not.
  3. 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. 
  4. 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

Anton Bujanowski Signature

View solution in original post

3 Replies 3
ERojas5
Participant

Create a customizable signature by language

SOLVE

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? https://www.loom.com/share/eec895ff9ff34c14a248d03099d3e2b2?sid=bdb2a9a6-05d7-437b-93ca-914594df3b41 

Anton
Thought Leader | Partner
Thought Leader | Partner

Create a customizable signature by language

SOLVE

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".

Bildschirmfoto 2025-06-05 um 19.37.57.png

 

Then select a contact you'd like to use for preview.

Bildschirmfoto 2025-06-05 um 19.40.21.png

 

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

Anton Bujanowski Signature
0 Upvotes
Anton
Solution
Thought Leader | Partner
Thought Leader | Partner

Create a customizable signature by language

SOLVE

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:

  1. 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.
  2. Values are case-sensitive. Just mentioning this because you got "english" lowercase and everything else is not.
  3. 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. 
  4. 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

Anton Bujanowski Signature