Can I customize the email 'container' html too?


(Bart) #1

Hi,

I’d like to update the layout of the emails to match the other emails that we send. What I’d need is a way to add a ‘wrapper’ around the email content, adding a logo, text-box and some elements like that. I couldn’t find this option in the Customize section of the admin - how would I do this?

Thanks!


(Bart) #2

Hi folks,

when re-reading this I realised that I could have been more clear with my request for help. Let me try again :slight_smile:

I’m aware that you can customise the text content of the emails, but I’d like to have a little more control over their layout. I’ve gone through all the admin options, thinking that maybe there’s an ‘email HTML template’ setting somewhere, but I haven’t been able to find it. Does such a thing exist and did I simply overlook it? Or would this require some custom coding/plugin?

Many thanks!


(Hank Pantier) #3

any followup on this? i would like to do the same thing…


(Rafael dos Santos Silva) #4

Today our email only allows the customizations trough outlets, and not the concept of containers.

Maybe if you open the div with the customizations in a header outlet, and close in a footer outlet it can work, and be generic enough to help many users.

What do you think?


(Hank Pantier) #5

what are outlets? where can i modify them?


(Rafael dos Santos Silva) #6

(Hank Pantier) #7

gotcha - i am looking for a way to customize ALL emails with our branding…


(Neil Lalonde) #8

There’s a string with id user_notifications.header_instructions that can be used to add some html to the top of all HTML emails. It can be customized from Admin > Customize > Text Content. Here’s a simple example that would display a centered image (like a logo) with a red line above the email’s content:

<p style="text-align: center; border-bottom: 2px solid #B90B26; padding-bottom: 15px; text-align:center;">
<img src="...absolute-url-to-an-image..." width="90" height="66">
</p>

If I want to change font in the emails, is it related to discourse or the mail service?
Customize font-family in the email 'container' html and make invite emails customizable
(Pad Pors) #9

:thinking: to test how this works, I added the same lines as above with the absolute url to our logo, to this text content:

but nothing happened for our invitation emails,

  • is any additional work needed?
  • does this still work?

p.s.:

  1. the logo was already in digest emails (only digest), without any input in this text area.
  2. it works for the digest, if I put the html lines in this string: user_notifications.digest.custom.html.header
  3. the above text doesn’t work for the invitation emails. but it works for simple notifs.

update:

can I customize font of the email, using this way?

although fonts in the preview digest has been changed using the uploaded font, in the email, it hasn’t been changed.

also for notifications (and not digest) the codes are shown in the email!

I’ve used this code lines in the header:

<style type="text/css" media="screen, print">

    @font-face {
      font-family: "sans";
      src: url("absolute url to font address on our server");


    }
    
  body, body input,  body select, body textarea,  body button, p, a, strong, center, h6{
    font-family: "sans";}
    
  </style>

<p style="text-align: center; border-bottom: 2px solid #0071BC; padding-bottom: 15px; text-align:center;">
<img src="absolute url to the logo">
</p>


Customize font-family in the email 'container' html and make invite emails customizable
(Pad Pors) #10

sorry to bring this up, but my question again:

can one change the font of an email, by adding an html code in the text content?

It seems to work for the digest when I check the digest preview, but in the email inbox, the font is still not uploaded to the digest.