Configuration

Module Configuration

To access the configuration of the module, select Stores->Configuration from within the admin panel...

Now scroll down to the 'ON TAP MODULES' option, and select 'No Password Login'...

You will be able to see module configuration options:

 

The configuration options are as follow: 

General
Enable (Yes/No)
If this option is set as Yes, then the module features/functionality will be enabled and can be seen on the front-end. 
Sign In Settings
Token Expires in

By default, the value is set to 10 minutes. You can edit and add numeric value here. 

This field determines the minutes after which the Sign In link which is sent to the customer expires. 

Email Sender

In this field, you can select any Option from the Available List. 

The email for Sign Up/Sign In Account which the user will receive will have "Sender Name" and "Email address" based on the selected option. 

 

You can add/edit the email address and sender name value from
Admin > Stores > Configuration > General > Store Email Address

 

 

 

Sign In (to existing account)

Here, you can select the email template which you would like the customer to receive.

 

The template used here is when there is a login attempt with an email address that already exists as a customer in Magento.

 

When the module is installed, it will create an email template that will be used in this field by default - which is named "OTP Sign In (Existing Account)". But you can change the email template and set new as you want. 

Sign In (to non-existing account)

Again, you can pick an email template to use. In this scenario, this template is used when an email address is used that does not exist as a customer.

 

The default template is named "OTP Sign In (New Account)".

 

Sign Up Settings
Token Expires in

By default, the value is set to 20 minutes. You can edit and add numeric value here. 

This field determines the minutes after which the Sign-Up link which is sent to the customer expires. 

 

Email Template update in Customer Configuration
Default Welcome Email Without Password

After configuring NPL module configuration, you also need to update the email template set for New Account. This can be achieved by changing the value for field: Default Welcome Email Without Password to New Account Without Password (OTP).

 

Path to change field values:

Go to Stores → Configuration → Customers → Customer Configuration → Create New Account Options -> Default Welcome Email Without Password

We strongly advise that you also set the "Require Emails Confirmation" to "Yes". If this is set to "No", then a user can enter any valid email address that is not already a customer and be immediately logged into the site (potentially placing an order). If this is set to "Yes", then it further enforces a login step via email, and so validates that the user has proper access to the email address used.

 

Customizing the email templates

In order to customize the email templates from the defaults installed, go to Marketing → Communications → Email Templates. Now click on the 'Add New Template' button.

In the Template drop-down select one of the default templates:

  • New Account Without Password (OTP) - this is used when a new account is created (assuming you have configured this as per "Email Template update in Customer Configuration" above)
  • OTP Sign In (Existing Account) - this is used when a login request is made using an email address that already exists as a customer.
  • OTP Sign In (New Account) - this is used when a login request is made using an email address that does NOT exist as a customer.

These templates contain specific content that must be used in order to ensure that links are generated correctly in the emails. These are as follows:

New Account Without Password (OTP)
The following code should be used to generate the link that enables the customer to complete their account registration.

{{trans
    'Thanks for signing up — click the link to be automatically signed in: <a href="%token_url">Sign in</a>'
    token_url="$this.getUrl($store,'customer/otp/auth/',[_query:[token:$customer.login_token.create().token],_nosid:1])"
    |raw}}

OTP Sign In (Existing Account) / OTP Sign In (New Account)
Notice the use of the $tokenUrl variable .

{{trans
        'Thanks for signing up — use this link to complete the sign up process and be automatically signed in: <a href="%token_url">Activate My Account</a>'

        token_url=$tokenUrl
    |raw}}

In general, the official documentation for editing email templates can be found here: https://docs.magento.com/m2/ce/user_guide/marketing/email-template-message.html