Documentation

wp-hide/2fa/email/email_message

Posted in: Getting Started (4) How To (16) Plugin Options Explained (41) Actions / Filters (33)   

Name: wp-hide/2fa/email/email_message
Type: Filter
Arguments:
(str) $message
(integer) $code
(integer) $user_ID

This filter allows customization of the HTML email message sent to users when using the 2FA email login feature in WP Hide PRO. It enables developers to modify the email content, including styling, text, and structure, before the message is sent.


add_filter( 'wp-hide/2fa/email/email_message', function( $message, $code, $user_id ) {
    // Customize the email message
    $user = get_userdata( $user_id );
    $custom_message = sprintf( 
        "Hello %s,\n\nYour Two-Factor Authentication code is: %s\n\nPlease use this code to complete your login.",
        $user->display_name,
        $code
    );

    return $custom_message;
}, 10, 3 );

The above code should be placed inside a custom file on /wp-content/mu-plugins/ folder or theme functions.php or a custom plugin.

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
Scroll to top