Customize Blocked Account Email Based on Connection

Problem statement

This article explains whether it is possible to customize the Subject/Body of the Blocked Account email template based on whether the user is using a DB connection or Email Passwordless.

Solution

It is possible to use a Liquid condition with the connection.name variable that is available in these templates. For example:

{% if connection.name == 'email' %} Blocked via Passwordless Email {% else %} Blocked with another connection {% endif %}

This will work with both the Subject and the Body.