# Email subject configuration options

**URL:** https://meta.discourse.org/t/email-subject-configuration-options/16530
**Category:** Feature
**Created:** [June 14, 2014, 4:10am UTC](https://meta.discourse.org/t/email-subject-configuration-options/16530 "2014-06-14T04:10:16Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![peternlewis](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/peternlewis/32/108888_2.png) [@peternlewis](https://meta.discourse.org/u/peternlewis)
#### Post date: [June 14, 2014, 4:10am UTC](https://meta.discourse.org/t/email-subject-configuration-options/16530/1 "2014-06-14T04:10:16Z")

</div>

I’d like emails to include the “Re:” in replies to aid subject threading in dumber mail clients (most annoyingly including Apple’s Mail.app). I coded this up and even submitted a pull request (thanks for looking at it @eviltrout). But then one of my users asked if it was possible to add the category to the subject line. I’m not sure I want to do this, but it is certainly reasonably so I’d like to look at adding a user configurable subject line with appropriate parameters available (ala reply by email address “%{reply\_key}” token).

This would apply to user\_replied, user\_quoted, user\_mentioned, user\_posted - I don’t think the others need further configuration options.

However, one thing I don’t understand though is in the English translations, and a few of the other translations (including zh\_CN) all four are the same subject, namely “[%{site\_name}] %{topic\_title}” - that would mean all four could be done in one setting and no translations are needed.

However in most of the translations (including zh\_TW), all four are different and include the username and text about the reply/mention/quote, and even extra text in the normal user\_posted subject, eg:

subject\_template: “[%{site\_name}] %{subject\_prefix}%{username} 在 ‘%{topic\_title}’ 討論話題發表了文章”

I would assume that irrespective of language, the basic format of all the subjects should be the same, so my guess is that originally, the English originally included custom emails for each type, and this was translated, and then the english removed this and the new translations have taken not, but the old ones remain.

And indeed, looking at the “Blame” history for the line in the english translation shows @sam made a change in December “FIX: Custom email subjects (x quoted you in [title], x replied to [title]) was removed, this broke email grouping. TBD, include info in footer somehow”

[https://github.com/discourse/discourse/commit/db1d01d1a269a3b9d3d2a67d4b49b1c442ab9f66](https://github.com/discourse/discourse/commit/db1d01d1a269a3b9d3d2a67d4b49b1c442ab9f66)

So given this, I would guess that we could have a single config for email subject (for the four normal types) which looked like this: “%{optional\_re}[%{site\_name}] %{topic\_title}” and that could include category and username and perhaps other tokens if desired by the user, but would be the same format for all four and would not be translated.

Any thoughts?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [June 14, 2014, 6:01am UTC](https://meta.discourse.org/t/email-subject-configuration-options/16530/2 "2014-06-14T06:01:12Z")

</div>

There is a much deeper issue with missing List-ID and other list email headers that I think are far more significant and fundamental than title changes. Let’s deal with that before cosmetic changes to titles.

---

<div class="post-metadata">

### Author: ![peternlewis](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/peternlewis/32/108888_2.png) [@peternlewis](https://meta.discourse.org/u/peternlewis)
#### Post date: [June 14, 2014, 7:00am UTC](https://meta.discourse.org/t/email-subject-configuration-options/16530/3 "2014-06-14T07:00:01Z")

</div>

I plan on looking at this as well, particularly: List-Id, Precedence: bulk, Mailing-List, and perhaps Delivered-To, and I’ll do that in parallel.

But this seems orthogonal to how the subject line should be handled, hence I’d like some direction on that before writing more code to do what I think it should do, in particular the ability to add the “Re:”, but even ignoring that, the ability to customise the subject line seems highly desirable - its more a question of whether all four need different customisations, and how it interacts with the translation system if at all.

Basically, the sooner I can get Discourse behaving well as a mailing list, the sooner I can get my users moved over and get the forum benefits that Discourse offers (plus escape from YahooGroups!). So I’m keen to put the effort in to make it happen.

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [June 14, 2014, 1:37pm UTC](https://meta.discourse.org/t/email-subject-configuration-options/16530/4 "2014-06-14T13:37:59Z")

</div>

For reference, the configurable subject line was discussed here:

> [@Show categories in e-mail notifications](https://meta.discourse.org/t/show-categories-in-e-mail-notifications/13814/15):
>
> @eviltrout can you implement a configurable substitution scheme string for email titles this week including {category}, {sitename}, {topictitle}, etc? Just the title of notification emails should be configurable in this manner.

And some of the other details regarding threading in mail clients like outlook being discussed here:

> [@Emails are not threaded in Outlook 2013](https://meta.discourse.org/t/emails-are-not-threaded-in-outlook-2013/16501):
>
> When turning on emails for every post to a forum, the emails do not thread correctly, at least in Outlook 2013. It looks like there’s an attempt to make it work, based on the In-Reply-To headers, but somehow it’s still not working :(. I imagine Outlook has some strange heuristics you might have to appease…

---

<div class="post-metadata">

### Author: ![peternlewis](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/peternlewis/32/108888_2.png) [@peternlewis](https://meta.discourse.org/u/peternlewis)
#### Post date: [June 14, 2014, 2:49pm UTC](https://meta.discourse.org/t/email-subject-configuration-options/16530/5 "2014-06-14T14:49:26Z")

</div>

Thanks @mcwumbly! Clearly, my abilities to find things out about Discourse are utterly failing me.

I will leave this coding for @eviltrout for now and see if I can find any other issues to address, and hopefully as soon as this is sorted I’ll be able to get serious about migrating my users over from YahooGroups (which can’t happen soon enough!).

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [June 14, 2014, 3:04pm UTC](https://meta.discourse.org/t/email-subject-configuration-options/16530/6 "2014-06-14T15:04:26Z")

</div>

> [@peternlewis](#):
>
> Clearly, my abilities to find things out about Discourse are utterly failing me.

Search in discourse still needs more love.

I often find things only because I know they already exist from having read them before, and that still takes a fair bit of effort.

If you really want to search, try google “[meta.discourse.org](http://meta.discourse.org): your search terms” or use the search box on the 404 page (desktop only):

[https://meta.discourse.org/foo](https://meta.discourse.org/foo)

But don’t sweat it. Often you’ll discover similar topics by cross references made in a reply like those above.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [October 9, 2014, 8:07pm UTC](https://meta.discourse.org/t/email-subject-configuration-options/16530/7 "2014-10-09T20:07:44Z")

</div>

OK this is now complete! See the `email subject` site setting and the associated howto.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [October 9, 2014, 8:07pm UTC](https://meta.discourse.org/t/email-subject-configuration-options/16530/8 "2014-10-09T20:07:48Z")

</div>


