Forum Discussion
Liquid: Can I add a variable to abort_message() function
- 27 days ago
The Braze documentation explicitly says that you can't use Liquid within the abort statement – you must use strings. That's not explained on the documentation page you've linked above, but it is on the connected content documentation page.
I imagine that you would conditionally assign a value to the abort_reason variable. Why not do the abort_message conditionally? Something along the lines of:
{% if criteria for abort reason 1 %}
{% abort_message('reason1') %}
{% elsif criteria for abort reason 2 %}
{% abort_message('reason2') %}
{% else %}
{% endif %}
The Braze documentation explicitly says that you can't use Liquid within the abort statement – you must use strings. That's not explained on the documentation page you've linked above, but it is on the connected content documentation page.
I imagine that you would conditionally assign a value to the abort_reason variable. Why not do the abort_message conditionally? Something along the lines of:
{% if criteria for abort reason 1 %}
{% abort_message('reason1') %}
{% elsif criteria for abort reason 2 %}
{% abort_message('reason2') %}
{% else %}
{% endif %}
Thanks for the documentation.
Exactly, I'll continue with conditional statements.
Related Content
- 8 days ago
- 11 months ago