CMS Development

orbitalwaves
Member

Contact tokens in email modules issue

Hi all,

I'm trying to create a module which embeds an image for model/color in emails.

This is the sample code, just trying to estract corresponding codes from the contact token values:

{% set colors = [
   {"code":"a", "name":"Color 1"},
   {"code":"b", "name":"Color 2"},
   {"code":"c", "name":"Color 3"}
]
%}
{% set models = [
   {"code":"01", "name":"Model 1"},
   {"code":"02", "name":"Model 2"},
   {"code":"03", "name":"Model 3"},
]
%}
Model: {{ models|selectattr('name','equalto',contact.pick_your_model)|first|attr('code') }}
Color: {{ colors|selectattr('name','equalto',contact.pick_your_color)|first|attr('code') }}

The output is:

Model:
Color:

I tried with for loops and macros, but same issue.

Seems like contact tokens filtered or used in functions are not processed in real time, while simple contact tokens are.

 

Model: {{ contact.pick_your_model }}
Color: {{ contact.pick_your_color }}

Output is:

Model: Model 1
Color: Color 2

Is it an issue?

Any workaround?

 

0 Upvotes
1 Reply 1
sharonlicari
Community Manager
Community Manager

Contact tokens in email modules issue

Hey @orbitalwaves      

 

I apologize for the delay in getting back to you. I am wondering if you were able to resolve this or if you still need assistance on this matter? 

 

Thank you

Sharon


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !




0 Upvotes