WordPress / two-factor

Two-Factor Authentication for WordPress.
https://wordpress.org/plugins/two-factor/
GNU General Public License v2.0
705 stars 145 forks source link

Email Template custormisation #568

Closed hkim94 closed 1 year ago

hkim94 commented 1 year ago

Is your enhancement related to a problem? Please describe.

Hi,

I am building a website that has public pages and membership pages.

For members' logins, Two-factor has been used. But as their age group is bit high.. the code is bit hard for them to read.

Is there any way I can customise the email template?

Proposed Solution

It would be great if we can customise the email template.

Is there any way to do it?

Designs

No response

Describe alternatives you've considered

No response

Please confirm that you have searched existing issues in this repository.

Yes

apmeyer commented 1 year ago

I am in a similar situation and would love a filter for customizing the email – similar to the hooks WordPress provides for other emails. Such as wp_new_user_notification_email, email_change_email, etc.

dd32 commented 1 year ago

The email templates used by the Email-based 2FA can be customized through these filters:

See the code for the documentation of what is passed: https://github.com/WordPress/two-factor/blob/master/providers/class-two-factor-email.php#L219-L243

apmeyer commented 1 year ago

Awesome, thanks!