Programmable email: Bug when in macros when passing contact property
SOLVE
Hello,
We have a programmable email that we send every month and we just found out that there is a bug in it. We are seeing some behaviour that was not happening the previews months.
In an email module, when using a macro that receives a contact property, the output is treated as a string instead of HTML so in the final email we are seeing HTML tags.
This is the minimun code to reproduce the error.
For a given contact with the property `monthly_consumption` set to '{"test":"anything"}'
{% set data = contact.monthly_consumption|fromjson %}
Programmable email: Bug when in macros when passing contact property
SOLVE
Hey @JuliaVallina, thank you for reaching out and providing detailed information about the issue you're experiencing with your programmable email.
I understand how frustrating it can be when previously working functionality starts to behave unexpectedly.
Based on your description, it seems the issue arises when the macro receives a contact property, resulting in the HTML tags being displayed as plain text in the final email.
One way to address this issue is to ensure that the content passed to the macro is not being treated as plain text. You can try using the |safe filter, which marks a string as safe for HTML output.
Programmable email: Bug when in macros when passing contact property
SOLVE
Hey @JuliaVallina, thank you for reaching out and providing detailed information about the issue you're experiencing with your programmable email.
I understand how frustrating it can be when previously working functionality starts to behave unexpectedly.
Based on your description, it seems the issue arises when the macro receives a contact property, resulting in the HTML tags being displayed as plain text in the final email.
One way to address this issue is to ensure that the content passed to the macro is not being treated as plain text. You can try using the |safe filter, which marks a string as safe for HTML output.