Skip to main content
Answered

Use list in metadata in events for email

  • June 8, 2024
  • 1 reply
  • 68 views

Hi all,

We have started using events to trigger transactional emails and it’s great that we can use the metadata to add content to the email.

We want to add a list of things that are pending from the user. The list could be as small as one thing or as big as the user added to their tasks. How can we achieve this ? Ideally iterating over the list and just adding the text that was added to the event metadata. And yes, we’re aware that there’s a limit of 20 metadata parameters and that strings can be a maximum of 255 characters long.

Thanks,

Aldo 

Best answer by Ebenezer.Laleye

Hi @Aldo G ! Ebenezer here from Engineering Support👋.

I don't believe Intercom support complex scripting like this to iterate over the metadata to display the list of tasks.

You may be able to achieve a dynamic list using conditional blocks.

Here a possible example of this. 👇

<p>Hello [User's First Name],</p>
<p>Here is a list of your pending tasks:</p>
<ul>
  {{#if task_1}}
  <li>{{task_1}}</li>
  {{/if}}
  {{#if task_2}}
  <li>{{task_2}}</li>
  {{/if}}
  {{#if task_3}}
  <li>{{task_3}}</li>
  {{/if}}
  <!-- Add more conditions up to task_20 as needed -->
</ul>
<p>Thank you!</p>

Hope this helps
 

View original
Did this topic help you find an answer to your question?

1 reply

Forum|alt.badge.img+4

Hi @Aldo G ! Ebenezer here from Engineering Support👋.

I don't believe Intercom support complex scripting like this to iterate over the metadata to display the list of tasks.

You may be able to achieve a dynamic list using conditional blocks.

Here a possible example of this. 👇

<p>Hello [User's First Name],</p>
<p>Here is a list of your pending tasks:</p>
<ul>
  {{#if task_1}}
  <li>{{task_1}}</li>
  {{/if}}
  {{#if task_2}}
  <li>{{task_2}}</li>
  {{/if}}
  {{#if task_3}}
  <li>{{task_3}}</li>
  {{/if}}
  <!-- Add more conditions up to task_20 as needed -->
</ul>
<p>Thank you!</p>

Hope this helps
 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings