Hoy he añadido una forma de insertar HTML y texto personalizados en los correos electrónicos de resumen/digesto. Anteriormente, solo se podía personalizar el esquema de colores. Ahora puedes insertar HTML arbitrario utilizando la interfaz Administración > Apariencia > Textos del sitio y buscando “digest.custom”. Filtra para obtener los correos HTML con “digest.custom.html”.
Configurar el campo header reemplazará la cabecera predeterminada, que actualmente es el logotipo de tu sitio en el lado izquierdo.
El resto de los campos puede utilizarse para insertar anuncios publicitarios, ofertas especiales, instrucciones adicionales de baja, anuncios importantes y cualquier otra cosa dirigida a usuarios que no han visitado tu sitio desde hace un tiempo.
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, lo siento. Escribí esto en el campo de contenido de texto para user_notifications.digest.custom.html.header. Mi expectativa era que centrara el texto mediante CSS.
<p style="text-align:center;">
El community de Postcall prospera cuando añades a la conversación.
<strong>¡Únete a uno de los temas a continuación y responde a alguien que lo necesite!</strong>
</p>
Y después de guardar/actualizar, terminó así (se eliminó el CSS en línea):
<p>
El community de Postcall prospera cuando añades a la conversación.
<strong>¡Únete a uno de los temas a continuación y responde a alguien que lo necesite!</strong>
</p>