Support » Plugin: Two-Factor » Customize email message

Viewing 2 replies - 1 through 2 (of 2 total)
  • Can Anybody help me?
    Now the email string look like

    	$message = wp_strip_all_tags( sprintf( __( 'Enter %s  to log in.', 'two-factor' ), $token ) );
    

    The result is “Enter 879889 to log in.”
    How can I make a break like a <br /> or add some css style?

    Plugin Author Kaspars

    (@kasparsd)

    There is a two_factor_token_email_message filter which can be used to customize the message. It passes the whole message as the first argument and the generated token as the second argument.

    So something like this should work:

    add_filter(
    	'two_factor_token_email_message',
    	function( $message, $token ) {
    		return sprintf(
    			'This is your custom message about the generated token %s',
    			$token
    		);
    	},
    	10,
    	2
    );
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Customize email message’ is closed to new replies.