Today I added a way to insert custom html and text to digest/summary emails. In the past, only the colour scheme could be customized. Now you can insert arbitrary html using the existing Admin > Customize > Text Content interface and searching for “digest.custom”. Narrow it down to the html emails with “digest.custom.html”.
Setting the header field will replace the default header, which is currently your site’s logo on the left side.
The rest of the fields can be used to insert banner ads, special offers, additional unsubscribe instructions, important announcements, and anything else that should be targeted at users who haven’t been on your site for a while.
Hi @neil, there seems to be a small issue with this - when you use the below popular topics template it does not include the There were 22 other new topics bit. This prevents us from adding extra blocks/sections to the mailer without it looking awkward:
Maybe because some of our categories are members-only?
Is there any other way to get custom html right at the bottom of the digest? Even in your example above I would argue that the sponsor messages should be below all regular content (or the template should be labelled as above 'new discussions since last visit' block).
If not, can I hack the template directly to change this? (Are there any links on how to do this please?).
Edit: I’ve worked around it by using the ‘above footer’ template.
Hi Neil. We’re looking to do something exactly like what you describe. But when I go to Admin > Customize > Text Content and search for digest.custom, I don’t get any results. (I can search for other terms and find them but not digest.custom.)
Is this part of a beta version of Discourse?
(The forum I’m working on is hosted by Communiteq (formerly DiscourseHosting) which always has the latest stable release of Discourse. I’m not actually sure how to figure out what version it is.)
Thanks for that info @codinghorror. Looks like we’re running Discourse 1.6.3. Does that seem to explain why we don’t find digest.custom on that screen?
Hi @neil. I have a question about this general topic. Does Discourse strip it out any formatting in the custom content such as inline css or table tags?
Our goal is to insert into certain emails, a blob of html which says:
Brought to you by: LOGO LOGO LOGO LOGO
Since we’re using the current stable branch (1.6.3) and we don’t have access to any of the “digest.custom” overrides, I’m attempting to stick this html into some other overrideable field such as “user_notifications.reply_by_email”.
So for example, I change:
user_notifications.reply_by_email [Visit Topic](%{base_url}%{url}) or reply to this email to respond.
to:
user_notifications.reply_by_email [Visit Topic](%{base_url}%{url}) or reply to this email to respond. MY-BLOB-OF-HTML-GOES-HERE
The problem I’m encountering is that somewhere along the line, any inline css within my blob of html is being stripped. Does Discourse strip the inline css out? It doesn’t appear that my email reader is doing the stripping (I tried gmail and one other) but the inline css is missing by the time it reaches my inbox.
The digest.custom.html values won’t be stripped of inline css or html tags. The problem you’re having with the reply_by_email string is because it’s processed as markdown, so html is being stripped out.
Ah sorry! I wrote this into the text content field for user_notifications.digest.custom.html.header. My expectations is that it would center the text via CSS.
<p style="text-align:center;">
The Postcall community thrives when you add to the conversation.
<strong>Jump into one of the topics below and reply to someone in need!</strong>
</p>
And after saving/refreshing, it ended up with this (stripped out the inline CSS):
<p>
The Postcall community thrives when you add to the conversation.
<strong>Jump into one of the topics below and reply to someone in need!</strong>
</p>