• Resolved squarestar

    (@squarestar)


    When setting up email templates and sending test emails, the emails received do not have the { ... } tokens replaced with their corresponding values (site name etc.)

    • This topic was modified 1 year, 8 months ago by squarestar.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter squarestar

    (@squarestar)

    Having looked at the code, the solution is to change lines 811 and 812 of /includes/classes/class-wp2fa.php to the following:

    $subject = wp_strip_all_tags( self::replace_email_strings(self::get_wp2fa_email_templates( $email_id . '_email_subject' ) ) );

    $message = wpautop( self::replace_email_strings(self::get_wp2fa_email_templates( $email_id . '_email_body' ), $user_id ) );

    Additions in italics

    Plugin Contributor robertabela

    (@robert681)

    Thank you for trying our plugin @squarestar

    I can confirm that the email templates work right out of the box and tags are working properly. So the issue is something specific to your setup.

    Can you please answer the below questions so we can troubleshoot your issue?

    1. What version of the plugin, WordPress and PHP are you running?
    2. Does this apply to all tags or some particular tags?
    3. Did you try all emails or some of them?
    4. Is the problem with the actual emails being sent by the plugins or the test emails? The tags are not replaced in the test emails.

    Looking forward to hearing from you.

    Thread Starter squarestar

    (@squarestar)

    Thanks Robert – the email templates work under normal operation but the test emails that get sent when you’re setting the plugin up don’t get run through the replace_email_strings() method. It gives the impression that the feature is broken.

    I made the changes to the plugin that I indicated in my second message above and it fixed the issue. It’s a much better experience when testing to see the correct values in the test emails.

    Plugin Contributor robertabela

    (@robert681)

    Thank you for the clarification @squarestar

    Indeed, it makes sense to have them fully functional also in the test so we’ll add that in the next update.

    By the way, please do not forget to spare a minute to rate our plugin and service. These reviews are really helpful.

    Also, should you have any other questions, please do not hesitate to ask.

    Have a great day.

    Plugin Contributor robertabela

    (@robert681)

    Hello @squarestar

    We have just released update 2.5.0 of the plugin which includes this fix. So basically now test emails will also be populated with the right details.

    Thank you for your suggestion. Please do not forget to spare a minute to?rate our plugin and service. Thanks in advance.

    Have a great day.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Email template tokens not being replaced’ is closed to new replies.