CMS Development

Antoine_AR
メンバー

If statement with personalization token on email

解決

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 いいね!
1件の承認済みベストアンサー
Mark_Ryba
解決策
投稿者 | Elite Partner
投稿者 | Elite Partner

If statement with personalization token on email

解決

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.

元の投稿で解決策を見る

2件の返信
Mark_Ryba
解決策
投稿者 | Elite Partner
投稿者 | Elite Partner

If statement with personalization token on email

解決

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
HubSpot製品開発チーム
HubSpot製品開発チーム

If statement with personalization token on email

解決

@Mark_Ryba , @Chris-M 

How would you all go about solving this?

0 いいね!