{% with messages = get_flashed_messages(with_categories=true) %} {% if messages %} {% for category, message in messages %}
{% if category == 'success' %}

Success!

{% endif %} {% if category == 'error' %}

Something went wrong...

{% endif %} {% if category == 'warning' %}

That was close!

{% endif %} {{ message }}
{% endfor %} {% endif %} {% endwith %}