Customize subject format for standard emails

(Arpit Jalan) #1

So you want to customize subject format for standard emails? Great, let’s get started!

The subject for standard emails can be customized from: Admin / Settings / Email / email subject

Available formatting options are:

%{optional_re}[%{site_name}] %{optional_pm}%{optional_cat}%{topic_title}

  • %{optional_re} → Re: (applicable if the post is a Reply)

  • %{site_name} → Community Title

  • %{optional_pm} → [PM] (applicable if the post is a Personal Message)

  • %{optional_cat} → [category] / [category/subcategory] {not applicable for uncategorized topics and PM)

  • %{optional_tags} → [tag1] [tag2] [tag3] (shows up to 3 tags)

  • %{topic_title} → Topic title

Complied subject for typical email notification:

[Community Title] [category] Topic title

Please note that a trailing whitespace will automatically be appended to %{optional_re}, %{optional_pm} and %{optional_cat}.

That’s it! You have successfully customized subject format for standard emails.

Customize subject format for digest emails
Emails are not threaded in Outlook 2013
Show categories in e-mail notifications
Group name in email subject for notification mails
Migrating from Google Groups
How to include Sent As name in invitations and other system-related email?
Email notifications not grouping nicely in
Allow adding tags as a custom subject format for emails
(Kane York) #2

Can we get the brackets moved out of optional_cat?

I’ll have to think about that…

(Michael Downey) #3

What is the value of %{optional_cat} for posts in uncategorized topics?

(Arpit Jalan) #4

In case of uncategorized topic the %{optional_cat} is skipped altogether. So the compiled subject will be like:

[Community Title] Topic title here

(Kane York) #5

So, it’s the empty string @downey.

(Peter N Lewis) #6

I believe you chose to (rightly, sorry, my bad!) remove the %{optional_re} from the default subject, so you might want to edit the howto to reflect that change.

(Arpit Jalan) #7

I believe that %{optional_re} should be left in the howto so that users can know that this option is available.

Edited the howto to reflect that %{optional_re} is not included by default.

(Domenic) #8

@techAPJ I am on Discourse 1.0.0 and this setting does not appear in the Admin / Settings / Email dashboard. Any ideas?

(Michael Downey) #9

It was introduced after the 1.0.0 release, so you’d need to be on the tests-passed or maybe beta settings now to see it.

(Domenic) #10

Oh :(. I guess I will wait for a new official release then.

(Jeff Atwood) #11

It’s pretty safe to be on the betas. This is on beta and it seems to work :wink:

(Daniel Reeves) #12

I agree the brackets should not be included. It’s clearer to just have the template include them explicitly and then you can do things like this: %topic_title [%{site_name}: %{optional_cat}]

(Though I guess that example’s ugly if there’s no category?)

(Tobias Eigen) #13

would it be possible to add eg %{optional_cat_slug} to this list of optional info to add to emails? We have long category names which are cumbersome when added to emails. The category slug would be better.

Add optional_cat_slug to email subject variables
(Sanket Nadhani) #14

How about customizing the digest email? I wanted to show the name of one or more posts (ideally the most popular post) in the subject instead of the standard [Community Name] Digest which doesn’t look fresh/inviting.

Couldn’t find any literature on that - any help?

Customize subject format for digest emails
(Michael Downey) #15

Unfortunately it’s not (yet) possible.

(Pablo Macaluso) #16

How to remove the [ ]

Thats make my emails as spam.


On my installation there is no trailing whitespace after %{optional_pm}, everything else works.

(Allen - Watchman Monitoring) #18

What indicates that that [brackets] are a problem?

You might try inviting an email from to your forum, and see how it rates the message.

(Clay Heaton) #19

I’m dealing with people who won’t know what PM means… Is it possible to change that text anywhere?

(Mariel Matze) #20

Hi all,

I’m finding that the %{optional_cat} returns the topic’s original category, not current category. Is there a way to make the category in email notification subject lines update according to the topic’s current categorization?