There can be situation when it is necessary to cancel the template generating. For example, it is needed to send the letter with recommended items by trigger, but if there are no reccomendations found for customer, then it is necessary to cancel the template generating and sending. For cancellation you should use {% cancel %}
tag.
Example of usage:
{% set recom = best_selling_products() %}
{% if recom|length > 0 %}
{# displaying recommended items #}
{% else %}
{% cancel %}
{% endif %}
If template has been cancelled, it will be fixed at action log.
You can specify the message, which will be displayed at action log in tag.
Example of usage with message:
{% set recom = best_selling_products() %}
{% if recom|length > 0 %}
{# displaying recommended items #}
{% else %}
{% cancel "Recommended items not found" %}
{% endif %}
In case of cancellation the letter/SMS/printed form template, which are generating manually, user will see the message, specified in {% cancel %}
tag.