Emails
The login code by email is delivered through Shopware's own building blocks: a mail template and a flow, both created at installation and editable in the admin. SMS codes do not use this path – they go through the configured SMS provider.
The "Login code" template
At installation, the extension creates the mail template type "Login code" (technical name customer_otp_verification) with a template in German and English. You edit it under Settings → Email templates – subject, HTML and plain-text content, per language. The shipped template uses "Your login code" as the subject and the sales channel name as the sender name.
The flow
The template is sent by the flow "Customer login code requested" in the Flow Builder (Settings → Flow Builder). It reacts to the event checkout.customer.otp_requested, is active after installation, and contains one action: Send email with the "Login code" template.
The event fires on every request for a login code by email – but only if a customer account exists for the entered address. For unknown addresses, no event fires and no email is sent.
If the flow is deactivated or the "Send email" action removed, no login code arrives by email any more – the form still shows the normal "code sent" message. After changing the flow, always verify with a real login.
Available variables
Among others, these variables are available in the template:
- {{ otpCode }}: the six-digit login code.
- {{ customer.* }}: the customer, e.g. {{ customer.firstName }}, {{ customer.lastName }} and {{ customer.email }}.
- {{ salesChannel.name }}: the name of the sales channel.
The wording update
Earlier versions of the extension called the code a "security code" in the email. An update unifies the wording on login code: in the template type name, the subject, the description, the HTML and plain-text content, and the name of the flow.
Customised templates are left untouched: each field is only updated if it exactly matches the shipped default – and each field is checked individually. Content you have edited therefore does not prevent the correction of an unchanged subject.
Your own flow actions
Because delivery runs through a normal flow event, you can attach your own actions to checkout.customer.otp_requested in the Flow Builder, or create an additional flow for it – for example to set a tag. The event provides the customer, the sales channel and the login code as data.