How to change the email text in WP 2FA

You are here:
  • Home
  • WP 2FA
  • How to change the email text in WP 2FA

The WP 2FA plugin uses emails to notify the users of changes, or of what they need to do. It sends the following emails:

  • when the site administrator configures2FA policies that apply to them,
  • to send the one-time login code over email (when using email 2FA),
  • when a WordPress user is locked (because they did not configure 2FA within the grace period),
  • when an site administrator unlocks a WordPress user.

Changing the WP 2FA plugin email templates

The text of these emails is generated from a number of templates saved in the plugin. You can change these templates from the Email Settings & Templates tab in the plugin configuration.

Email and template settings in WP 2FA

From this page you can:

  • Change the subject of the email,
  • Change the email text,
  • Disable / re-enable specific email templates (using the Send this email setting).

What are the template tags?

Template tags are text-snippets that you can use in an email’s subject and template. These tags are then replaced with a real value when an email is sent to the users. The below is a list of available template tags in WP 2FA:

  • {site_url}
  • {site_name}
  • {grace_period}
  • {user_login_name}
  • {login_code}
  • {2fa_settings_page_url}

Therefore in the below example, the tags will be replaced with actual values when sent to the user. Instead of the tag {site_url} the plugin will insert the URL of the website, instead of the {grace_period} the plugin will insert the configured value, for example 3 days, instead of the {user_login_name} the plugin will insert the first name of the user, for example, Robert.

Email template in WP 2FA

Note: the email template editor is a fully blown editor and the emails are in HTML format. Therefore it is very easy to update the template to match your business’ branding.