Notification Emails - different formats (HTML and plain text?)

(Jerome Spaargaren) #1

Sometimes a notification email has the Visit Topic link displayed as a button, and sometimes as a plain link (underlined in blue).

As far as I can tell, these are based on different email templates but all rely on the link generated by the respond_instructions part of the email templates so I cannot work out why the links are being created differently.

I suppose one type of email is being formatted as HTML and the other coming out in plain text format?

For explanatory purposes -

a. the user_posted template creates a button-type link in the email content that looks like this (NB we have customized the text):


b. the user_replied template creates a plain link in the email content looking like this:


We’d much prefer them all to have the HTML formatted email but can’t work out how to.

Thanks in advance for any elucidation or fix you can provide.

(Jeff Atwood) #2

This is not the case, you’re seeing an email client block the email CSS somehow. This is a local email client problem not a Discourse problem.

(Discourse emails do have a plaintext version in every payload, view source on the email to see it, but that’s not what you are showing in your screenshot)

(Jerome Spaargaren) #3

Thanks for the reply, and the suggestion, which was hopeful but not the solution.

There are two reasons for this conclusion:

  1. Having tested this, it doesn’t matter what email client is used to view the emails, they always come out in exactly the same format - the HTML ones come out fine and the plaintext ones are just, well, plain. Each consistently different. So it’s not the email client, it seems.

  2. The two differently formatted emails should basically be identical so why would one be treated differently by the email client to the other?

(Jerome Spaargaren) #4

Here is the source text for the first format of notification email:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><p>You have received a reply to your post on Springboard.</p>
<p><a href="">View Springboard Topic</a></p>
<p>To unsubscribe from this Springboard topic, <a href="">click here</a>.</p>

And here is the source text for the second format:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div>
    <p>You have a new post on Patently Springboard.</p>
  <div style="color:#666;">
<hr style="background-color: #ddd; height: 1px; border: 1px;; background-color: #ddd; height: 1px; border: 1px;">
<p><a href="" style="text-decoration: none; font-weight: bold; color: #006699;; background-color: #006699; color:#ffffff; border-top: 4px solid #006699; border-right: 6px solid #006699; border-bottom: 4px solid #006699; border-left: 6px solid #006699; display: inline-block;">View Springboard Topic</a></p>
  <div style="color:#666;"><p>To unsubscribe from this Springboard topic, <a href="" style="text-decoration: none; font-weight: bold; color: #006699;; color:#666;">click here</a>.</p></div>
<div itemscope="" itemtype="" style="display:none">
  <div itemprop="action" itemscope="" itemtype="">
    <link itemprop="url" href="">
    <meta itemprop="name" content="Read full topic">

The first one is the one that is coming out “plain”. The second format is much better, so would prefer that if they could be output in the same format - but the main problem is that they are inconsistent… so whatever format is used, at a minimum they should be the same if possible…

(Jeff Atwood) #5

It looks like you modified the template? No repro here on meta or try.

(Jerome Spaargaren) #6

Hi @codinghorror - I have a feeling I know what might be causing it. I have specifically avoided modifying the templates - however I have switched this site setting on:


This might be going via a different in-built template than the normal ones?

(Jeff Atwood) #7

Oh aha! Thank you that definitely helps :wink:

@techapj can you normalize these two when you get a chance?

(Arpit Jalan) #9

With private email setting enabled I am unable to repro this locally for email received for topic replies.


(Jerome Spaargaren) #10

Hi @techAPJ

Thank you!

On further testing here it seems that, to repro, you will need to customize the text of the email template for user_replied (apologies, I was mistaken in my response above, the email templates had been modified, and it seems to be down to this.)

I have reproduced the issue as follows:

a) Modify the User Replied email template, e.g.


Before modification, the user replied email message (which is triggered when you Reply within a post using the grey Reply button, rather than the Blue one at the bottom) looked like this:


After modification, it looks like this:


(Jeff Atwood) #11


I’m closing this topic.

(Jeff Atwood) #12