Support » Plugin: wpMandrill » wpMandrill Affecting Password Reset Email Content and Link Formatting

  • 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: Username: testuser If this was a mistake, just ignore this email and nothing will happen. To reset your password, visit the following address: />

    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.

Viewing 15 replies - 1 through 15 (of 16 total)
  • Can anyone from MailChimp address this please?

    Plugin Author MC_Will


    Hi Adam,

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

    I’ll have a look at that now and report back…

    Do you mean to checkmark this setting?

    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.

    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!

    Plugin Author MC_Will



    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.

    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.

    Plugin Author MC_Will


    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.

    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;)

    Plugin Author MC_Will


    Of course I do!


    Ha! Perfect.

    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.

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

    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";

    I am newbie of wordpress.
    I have to fix the issue.
    Let me explain detail.
    My website ( 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
    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?

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘wpMandrill Affecting Password Reset Email Content and Link Formatting’ is closed to new replies.