Aborting Messages
Optionally, you can also now abort messages within conditionals. Here are some examples of how this feature can be used in marketing campaigns:
Aborting message if “Number Games Attended” = 0:
For example, let’s say that you did not want to send the above message to customers who had not attended a game:
This message will only send to customers who are known to have attended a game.
Messaging English speaking customers only:
You can message English speaking customers only by creating an “if” statement that’ll match when a customer’s language is English and an else statement that’ll abort the message for anyone who does not speak English or does not have a language on their profile.
1
2
3
4
5
6
{% if ${language} == 'en' %}
Send this message in English!
{% else %}
{% abort_message() %}
{% endif %}
By default Braze will log a generic error message to your Developer Console log:
1
{% abort_message %} called
You can also have the abort_message log something to your Developer Console log by including a string inside the parentheses:
1
{% abort_message('language was nil') %}