Question

I'm trying to modify the our email message for a forgot-password module.

I'm sending a html content to the json field html and here's the code

<html>
  <head>
    <title></title>
  </head>
  <body>
    <p>Hello <?= $userName; ?>,</p>
    <p>
      Someone has requested a link to change your password, and you can do this through      the link below.
    </p>
    <p>
      <a href="<?= $webUrl; ?>">Change my password</a>
    </p>
    <p>
      <?= $webUrl; ?>
    </p>
    <p>
      If you didn't request this, please ignore this email. <br><br>
      Your password won't change until you access the link above and create a new one.<br>
    </p>
    <p>
    Best Regards, <br><br>
    The Lifebit Team
    </p>
  </body>
</html>

After a I run the mandrill api, The color of the message is now purple (sometimes most lines are black). Here's the snapshot. The image of the bug

I didn't set any colors in my html code but why is it that some parts are purple? Thoughts?

Thanks ahead!

Was it helpful?

Solution

Sometimes the email client will manipulate the appearance of the email because it is quoted content, or appeared in a previous email.

I know for example, that Gmail will actually hide the content of a previous mail to show you only new content.

In the screen shot, my boss' signature is trimmed because it is not the first message from him in the thread.

Think about it this way, sometimes a browser will "paint" a link in a different color to indicate that it has already been visited (purple for the popular ones). There might be a similar mechanism in the mail client. If for example, you send the same email twice, the second one might appear different as it's content has already been viewed previously.

I assume that the formatting issue is something that is happening on the users email client. There is not much you can do about that other than explicitly defining colors and styles for each message that is sent.

OTHER TIPS

it looks like CSS isn't being inlined for your Mandrill emails. Mandrill doesn't automatically inline CSS styles as MailChimp does, but you can optionally inline your CSS which should resolve the font styling issue you've noticed in Outlook. You can either set it by default for your account on the Sending Options page in your Mandrill account, or enable it on a per-message basis (using the inline_css parameter (API) or X-MC-InlineCSS (SMTP headers)). This will work for HTML under 256KB.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top