Customizable Email Templates

AI-generated summary

Customizable Email Templates has been introduced, allowing admins to modify email templates via Admin > Customize > Email Templates. eviltrout demonstrated the feature with a screenshot.

Users requested additional features, such as:

  • A help button to explain available variables cpradio
  • Reverting to the original template cpradio and zogstrip, which led to a commit eviltrout
  • Interpreting site variables in the preview watchmanmonitor
  • Adding %{context} to the mailing list mode template watchmanmonitor
  • Inclusion of the digest template in editable templates tobiaseigen, but eviltrout explained that it uses a custom ruby template
  • Swapping the single email body with the digest body for “mailing list mode” users watchmanmonitor, but codinghorror suggested it’s beyond the scope of simple template text changes
  • Adding the %{context} block to mailing-list emails watchmanmonitor and Jenn_Briden
  • Editing email templates to exclude images adopilot

Don’t like the text in our emails? Well now you can change them! (as long as you’re tracking our tests-passed branch)

Just visit Admin > Customize > Email Templates and you’ll be presented with this nifty interface:

Give it a whirl and let us know how it works out for you.

29 Mi Piace

Is there a help button or anything that could help us know what variables can be used and placed within the emails?

14 Mi Piace

I can see storing the various “required” bits for each template in text below each template.

fwiw, I’m really impressed at the amount of control this gives us.. I think I can finally stop hand-editing my server.en.yml during every release.

This is really exciting!

4 Mi Piace

Showing the variables is somewhat tricky as not every variable is available to every template. There are a few that are always around and we could explain those though!

1 Mi Piace

Fair enough. Is there a way to revert back to the original template? (I would try it out locally, but it seems my dev branch is broken by a recent commit, I keep getting There is no route admin) (nevermind, it was my own fault, I still had the DISCOURSE_NO_CONSTANTS=1 enabled)

1 Mi Piace

I don’t think so but that is a very good idea :+1:

3 Mi Piace

I agree with @zogstrip – that’s a great idea:

https://github.com/discourse/discourse/commit/8eeb027c653d37452d220a08ae04eafd34b833f9

10 Mi Piace

Could we get the the site variables {site_name} etc be interpreted in the preview?

Which is the message used when a member is in mailing list mode.. could we add %{context} to it now?

Is there any way to add the digest template to this list of editable templates? That is a powerful tool and many admins would benefit from being able to add their branding and customizations to it.

7 Mi Piace

Unfortunately the digest doesn’t use our normal template code as it uses a custom ruby template due to their being a lot of display logic present.

You can now customize all the text though!

5 Mi Piace

I’d like everyone to benefit from the rich replies w history.

For people using “mailing list mode” can we swap the single email body with the digest body?

I’m not sure I understand – the digest body is the recent content for the site we think the user would be interested in. Can you provide a more detailed example of what you want?

1 Mi Piace

I think you want custom templating logic here, which is far beyond the scope of simply changing the template text. Should be its own topic.

2 Mi Piace

The “User Posted” template has %{message} and then %{context}

There are requests for context to be something that even mailing list users get.. I wondered if/where we could add the existing %{context} block to the mailing-list emails

1 Mi Piace

I agree with this request. We would like the ability to edit the title of email digests and email post notifications. We have some forums with long names and would like to be able to hide the forums and show only the post’s title.

forgive me if is not right place to ask.
Is there a way to edit e mail templates to not sending pictures inside e mails.
Our forum is on private site.
And e mails contain link to private addresses.
when I get mail and try to open i webmailserver whic is on the other side of firewall
picutres looks ugly.
Bicous they onli represnts dead links to private sites

1 Mi Piace