EOL- tags control both sides of this flow: the login page with request and code entry, and the email with the code or link. In addition, there are two button tags and one form tag that are only used in this context and are therefore described here.
Guide: Login by email without a password · Reference: EmailOTPLogin section
Where the tags apply
The entire flow in the shop runs through a single template, namely the login template from theTemplates section of the shop configuration (ws_login.htm). The shop system displays this template in three situations: as the normal login page, after an email has been requested, and after an error. The template itself decides which view is displayed based on the value of EOL-PendingEmail.
The email is created from a separate template that is entered in the EmailOTPLoginMail section. Only there are EOL-Code and EOL-MagicLink filled. All other EOL- tags are active in both templates.
Is the function enabled
EOL-Enabled takes test operation into account. If the configuration contains allow = test, the bracketing only applies in the shop’s test mode. This lets you build the function in the live shop without it being visible to buyers.
EOL-MethodIsCode and EOL-MethodIsLink only read the Method setting and do not check whether the function is enabled. Therefore, always use them within EOL-Enabled.
All three tags are pure bracketings, both positive and negative.
Request or code entry: EOL-PendingEmail
When a buyer has requested an email, the shop remembers the entered address in the session.EOL-PendingEmail outputs it as a single tag and serves as a bracketing as long as it is present. The template uses this to switch between the two views.
Form fields and buttons
The request does not need its own form tag. It runs via the normal login formFORM-LoginKnownUser. Only the code entry has its own target with FORM-EOL_Verify.
BT-EOL_Request only outputs something if the function is active and the login template is displayed. On any other template, and when the function is disabled, the name attribute remains empty and the button does not trigger any action.
Clicking the “Cancel” button deletes the remembered address and returns the buyer to the login page. Because it is in the same form as the code field, it needs the formnovalidate attribute. Otherwise, the browser first requires a code before it submits the cancellation at all.
FORM-EOL_Verify is enough for the shop to know what to do.
Content of the email
EOL-Code and EOL-MagicLink are only filled while the email is being created. Afterwards, the shop deletes the code and the link from memory and only keeps a check value. On the login page, both tags therefore return nothing and cannot be used as a bracketing either.
EOL-MagicLink is an absolute HTTPS address without a session ID. The buyer can therefore open the link on a different device than the one on which they requested the email. The login then takes place on the device on which they click. If MagicLinkBindIP = yes is set in the configuration, this only works if both devices access the internet with the same IP address. Otherwise, error message 5 appears.
The fields EOL-CodeLength and EOL-ValidityMinutes output the value actually used. A value outside the permitted range has already been pulled to the limit. Both always apply as a bracketing.
Displaying errors
There is a separate error tag for the request and for the check. As a single tag, it outputs the error number. As a bracketing without a parameter, it applies as soon as the number is not 0. With a parameter, it applies for exactly this number.EOL-RequestError
Error 5 also occurs if no template is entered in the
EmailOTPLoginMail section. It is therefore the typical error of an incomplete setup.
EOL-VerifyError
For errors 3 and 4, the following view depends on the method. After an incorrect code entry, the buyer stays in the code entry form. After an invalid link, they end up in the request view, often on a device on which there is no remembered address at all.
For request errors 4 to 6, the shop often also sets
EOL-VerifyError to 1, because no valid request was created. In this case, only the request error should be displayed, because otherwise the buyer sees two messages for the same problem.
After a successful check
If the code or link is correct, the shop logs the buyer in. A new session ID is assigned, the counter for failed attempts is reset, and the time of the last login is recorded. If the buyer has set up two-factor login, they do not go directly to the customer account afterwards.The tags at a glance
Related topics
- Guide: Login by email without a password
- Reference: EmailOTPLogin section
- Reference: EmailOTPLoginMail section
- Reference: FORM- (Forms)
- Reference: Buttons for customer account and login
