WordPress.org

Forums

wpMandrill
wpMandrill Affecting Password Reset Email Content and Link Formatting (17 posts)

  1. Adam W. Warner
    Member
    Posted 1 year ago #

    Hi guys,

    We’ve just found an issue with the formatting and link included in password reset emails. We've narrowed it down to the wpMandrill plugin as deactivating solves the issue described below.

    Email comes in like this:

    (username edited to protect the innocent)
    Someone requested that the password be reset for the following account: http://ourwebsite.com/ Username: testuser If this was a mistake, just ignore this email and nothing will happen. To reset your password, visit the following address: /ourwebsite.com/wp-login.php?action=rp&key=2C4WNkhEGno3AVQhVqeX&login=testuser>

    Notice the lack of line breaks and also that the “http:/” is missing from the front and that there is a “>” symbol at the end.

    When clicking this link, it goes to a 404 (not surprising). If you add the “http:/” and remove the “>”, it works as expected taking the user to the password reset page.

    http://wordpress.org/plugins/wpmandrill/

  2. Adam W. Warner
    Member
    Posted 1 year ago #

    Can anyone from MailChimp address this please?

  3. MC_Will
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Adam,

    Did you try to activate the switch "Replace all line feeds by
    in the message body?"?

  4. Adam W. Warner
    Member
    Posted 1 year ago #

    I'll have a look at that now and report back...

  5. Adam W. Warner
    Member
    Posted 1 year ago #

    Do you mean to checkmark this setting?

    Content
    Replace all line feeds ("\n") by
    in the message body?
    If you are sending HTML emails already keep this setting deactivated.
    But if you are sending text only emails (WordPress default) this option might help your emails look better.

  6. Adam W. Warner
    Member
    Posted 1 year ago #

    OK, that worked for password reset emails. We also use some HTML email sends from the Easy Digital Downloads plugin. You're setting says not to activate with HTML emails, so we'll see how that goes;)

    Thanks for your reply here. I appreciate it!

  7. MC_Will
    Member
    Plugin Author

    Posted 1 year ago #

    Adams,

    We just released a new version of this plugin. We added a new filter, mandrill_nl2br, that allows you to change that flag on the fly.

    For example:

    function forgotMyPasswordEmails($nl2br, $message) {
        if ( in_array( 'wp-retrieve_password', $message['tags']['automatic'] ) ) {
            $nl2br = true;
        }
        return $nl2br;
    }
    add_filter( 'mandrill_nl2br', 'forgotMyPasswordEmails' );

    Let me know how it goes.

  8. Adam W. Warner
    Member
    Posted 1 year ago #

    I'm going to call you Will, hope that's your name:)

    So yes, checking that setting has added some unexpected line breaks in both our EDD emails and also our Gravity Forms submissions (which is connected to our HelpScout account and making for some support tickets with a lot of white space;)

    Thanks for providing that filter function. Can you confirm, is that added to our theme's functions.php file or somewhere else.

    I didn't see any option in the Mandril plugin settings to add custom code.

  9. MC_Will
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, that's my name :)

    You could add it to your theme's functions.php file, yes, but my preferred method is to add it to a general purpose plugin specially created for the site though. It doesn't need to do anything fancy.

    If you're using a child theme, then it's a bit better... but still, I'd go for a basic utility plugin created for the site.

  10. Adam W. Warner
    Member
    Posted 1 year ago #

    Got it, thanks. Will be testing and will come back with results:)

    p.s. Do you rap too, because "MC_Will" sure sounds like you should be;)

  11. MC_Will
    Member
    Plugin Author

    Posted 1 year ago #

  12. Adam W. Warner
    Member
    Posted 1 year ago #

    Ha! Perfect.

  13. nullvariable
    Member
    Posted 1 year ago #

    I also experienced issues with this, turning on the checkbox fixed the password reset emails, the filter above had no effect with the checkbox off. I didn't seem to need the filter with the checkbox on.

    Perhaps this should be a default for that type of email?

    Also that video cracked me up, thanks for being awesome.

  14. kylerollins
    Member
    Posted 1 year ago #

    I had this problem too...just disabled the app and moved on. May have the patience to mess with these settings later...

  15. hjbarraza
    Member
    Posted 11 months ago #

    I modified wp-login.php line 358 to 363 and it worked great.
    I'm just afraid that it will get overwritten next time wordpress self-updates itself.

    $message = __('Someone requested that the password be reset for the following account:') ."<br/>" ."\r\n\r\n";
    	$message .= network_home_url( '' ) . "\r\n\r\n";
    	$message .= sprintf(__('Username: %s'), $user_login) . "<br/>" ."\r\n\r\n";
    	$message .= __('If this was a mistake, just ignore this email and nothing will happen.') . "<br/><br/>" ."\r\n\r\n";
    	$message .= __('To reset your password, visit the following address:') . "<br/>" ."\r\n\r\n";
    	$message .= '<a href="' . network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login')  .'">' . network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') .'</a>'. "\r\n";
  16. norahtike
    Member
    Posted 6 months ago #

    I am newbie of wordpress.
    I have to fix the issue.
    Let me explain detail.
    My website (abc-marketing.com) has users to log into that site.
    So, the user needs email, username, password to be registered.
    Sometimes, they may need to reset their passwords when they forgot.
    My difficulty is there ('Forgot password' function is not working).
    If I clicked Forgot Password, our office emails don't get the password reset email.
    My wordpress project sends the forgot password email to gmail.
    My wordpress project does not send the forgot password email to office outlook email.
    Most of the users are office staff. So , they should get the email of password reset email with activation link.
    Actually, it is not getting.
    After all, I use wpmandrill plugin for sending password reset reminder email.
    I created the Mandrill API.
    I downloaded and activated the mandrill plugin and put Mandrill API into plugin.
    Saved Changes.
    I clicked 'Forgot Password'. I received the password reset email send via mandrill.com.
    However, The activation link didn't include. I didn't get the link to reset my new password.
    Could someone help me and advise me to send email with reset password link?

  17. norahtike
    Member
    Posted 6 months ago #

    May I ask one more things.
    Can we set Reply-To (email) header as a blank when we send email?
    Will there be showing via or on behalf of after we inserted DKIM & SPF record?
    Can we change From (email)?
    Many help appreciated.
    Thank you.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • wpMandrill
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic