How to change the style of the email template of the digest?


(Benjamin Meghnagi Rozenberg (Broz)) #1

Hi, i would like to change the css style of the recap template (digest), that is sent to users.


(Robin Ward) #2

Unfortunately the only part of the digest that is editable is the logo, which can be done via site settings.

CSS in email is quite a tricky task, so we’ve hardcoded the styles in the template:


(Benjamin Meghnagi Rozenberg (Broz)) #3

Hi @eviltrout, thank you very much for the answer, i really appreciate it.
Is there a way to overwrite this file? Maybe with a plugin?


(Robin Ward) #4

Unfortunately I don’t think .erb templates can be overridden in plugins, although maybe someone on the @team could correct me.


(Neil Lalonde) #5

The .erb template can’t be overridden by a plugin.

Car Talk has its own digest emails. How we did that in a plugin was to treat it as a new email entirely. You could disable Discourse’s default digest emails and then use your own. It’s more complicated than making a new template though…

Not ideal, but gives you a lot of freedom to customize the data and logic.


(Brendan Schlagel) #6

One small thing that could be useful here: a way to change the header image size for this email. See below images — in the first (default) the header image is almost comically tiny (40px height). The latter I tried making three times larger (120px, the actual size of the uploaded image) and it looks much better. Not sure if there’s any way to do this currently but would be nice to be able to use the larger image!


(Hosein Naseri) #7

Where can I find this file in my server? I need to change it manually. As reported here, digest emails have serious problems with rtl language and I cant wait till it gets fixed.


(Rich) #8

Is there anyway to style the element span.badge-category-bg used in the New for you section of these emails? I’ve noticed there’s some inheritence of styling from the customisable stylesheets into the digest, and we have a problem where these items are not sized properly in email clients.


(Stephen Chung) #9

Me too. 40px just isn’t large enough to have the logo blend in with the rest of the template, which uses HUGE fonts.


(Muhlis C) #10

It can.
I have created a plugin for client to override the default digest template.


(Sam Saffron) #11

Feel free to publish it in the #plugin category


(Muhlis C) #12

I have published it:


(Kenny Meyer) #13

I wonder if there’s a better way to do that now, which does not require a custom plugin nor direct code editing?


(Quintin Par) #14

November 2017 calling. Is it possible to customize all parts of the email now? Use our own html template?


(Stephen Chung) #15

Sadly, I don’t think the state of the art in emails have progressed much…


#16

@neil can you clarify why it isn’t possible to override an erb template with a plugin?

thanks!


(Neil Lalonde) #17

@davedogs Is this not what you want: