CMS Development

Antoine_AR
Miembro

If statement with personalization token on email

resolver

Hello,

 

I am trying to show some text depending on the value of a contact property display through a personnalization token.

 

I tried to use if statement, but it doesn't work. I do not have the correct content in my email.

I even tried the unless statement, but I had no result either.

 

To give you some context : When a user complete a form, I retrieve all data from this form. Then I use a worflow to send an email with the data I retrieved.

What I'm trying to do is, when a user do not enter an optionnal field in the form, then in the content's email has to change depending on these optionnal field.

 

Here is the code I'm using to test it (when a value = "Select", it means that the user didn't fill an optionnal field) :

 

<table style="background-color: white; padding: 32px 24px;">
  <tr>
    {% if contact.form__experience_1 ==  "Select" %}
    <td>
      {% inline_rich_text field="content_2" value="{{ module.content_2 }}" %}
    </td>
    {% else if contact.form__experience_2 ==  "Select"  %}
    <td>
      {% inline_rich_text field="content_3" value="{{ module.content_3 }}" %}
    </td>
    {% else if contact.form__experience_3 ==  "Select" %}
    <td>
      {% inline_rich_text field="content_4" value="{{ module.content_4 }}" %}
    </td>
    {% else %}
    <td>
      {% inline_rich_text field="content_1" value="{{ module.content_1 }}" %}
    </td>
    {% endif %}
  </tr>
</table>

 

I hope we can find a solution for this issue.

Don't hesitate to tell me if you need more information.

 

Thank you,

Antoine

0 Me gusta
1 Soluciones aceptada
Mark_Ryba
Solución
Colaborador | Partner nivel Elite
Colaborador | Partner nivel Elite

If statement with personalization token on email

resolver

Hey @Antoine_AR, I would review this documentation to make sure you're using the "programmable email beta" correctly, which should have no problem working with the code you provided.

 

Additionally, just based on my previous experience, I would add a short delay step in your workflow (a couple of minutes) before the email is sent, just in case any data is slow to update in the CRM which could lead to inaccurate logic cases or value displays.

Ver la solución en mensaje original publicado

2 Respuestas 2
Mark_Ryba
Solución
Colaborador | Partner nivel Elite
Colaborador | Partner nivel Elite

If statement with personalization token on email

resolver

Hey @Antoine_AR, I would review this documentation to make sure you're using the "programmable email beta" correctly, which should have no problem working with the code you provided.

 

Additionally, just based on my previous experience, I would add a short delay step in your workflow (a couple of minutes) before the email is sent, just in case any data is slow to update in the CRM which could lead to inaccurate logic cases or value displays.

dennisedson
Equipo de producto de HubSpot
Equipo de producto de HubSpot

If statement with personalization token on email

resolver

@Mark_Ryba , @Chris-M 

How would you all go about solving this?

0 Me gusta