Configuring the email email templates in WP 2FA

You are here:
  • Home
  • WP 2FA
  • Configuring the email email templates in WP 2FA

When using the WP 2FA plugin to setup two-factor authentication (2FA) on WordPress, you will notice the plugin sends a number of emails to your sites users. These messages are used in several situations, which we will detail below.

What emails does WP 2FA send?

Enforced 2FA notification email

When you enforce 2FA the plugin sends this message to your (applicable) users. This message is a simple notification which lets the user know they need to setup 2FA within your specified grace period and is sent when your plugin settings are changed.

So what does this mean? Well, let’s say you enforce 2FA on all users with the role’s editor and subscriber. When you apply the settings, the plugin will scan your users and notify those whom your policy applies to.

This is also true when making subsequent changes. For example, if you have a policy setup like above, if you where to then further change your policy by extending the grace period, any users who fall into your desired criteria and have not yet configured 2FA, will be notified once again based on your changes.

Login code email

The plugin sends this email to your users when they use the email 2FA method. It sends this email with the login code both when the user is setting up the authentication, and when logging in.

User account locked notification email

When you enforce 2FA on your users, or a specific set of users, they are given a certain amount of time during which to enable 2FA. This time is called the grace period. If a user fails to configure 2FA on their profile within the grace period – the account will be locked and the user will be notified using this email.

User account unlocked notification email

When an administrator unlocks a locked user’s account, the plugin sends this message to notify the user.

Configuring the WP 2FA emails templates

In the WP 2FA plugin you have total control of the emails outlined above. These messages can be configured within the Email settings & templates tab in the plugins settings. In keeping with our “ease of use” ethos we have employed in all aspects of WP 2FA – customizing these messages to your tastes is a breeze.

Let’s take a look at the “Enforced 2FA email” setting and see how it works.

The email notification templates in WP 2FA

As you can see, the setting itself is very simple to understand. We have the email’s subject and content all laid out for us in an easy to use WYSIWYG editor. To customize the email simply replace the content as you wish. There are a few special “tags” you will see both in the default content but also listed in the setting itself. These “tags” are unique to our plugin and are a neat way to personalize your messages. You can use them to include your users login name etc, but they also can contain crucial information such as login codes. Here is a complete list of available tags and their uses.

{site_url} – A simple link to your sites homepage
{site_name} – The name of your site
{grace_period} – Your currently specified grace period (default 3 days)
{user_login_name} – The users login name
{login_code} – The code used to verify a user upon login.

Customizing the “from” email address and display name

By default our plugin uses your sites admin email address and name. These can be found under the General Settings in your WordPress dashboard. If you wish to customize the “from” email address and display name in the context of WP 2FA, you can do so via the Email settings & templates area found in our plugins settings.

Configuring the From email address & name

Select the setting Use another email address and the relevant fields will be revealed. You can then supply your desired email address and display name.