Show categories in e-mail notifications

I’m trying to talk the folks at Canonical into moving some/all of our internal lists to Discourse, and this will almost certainly be a deal breaker. We need an easy way to be able to direct all email notifications from a single category into a single email folder (or tag in gmail). Right now, that’s impossible.

3 Likes

@techAPJ worked on allowing custom email titles, where is that at? is there a howto?

2 Likes

The “email subject” can be customized from Admin site settings:

Formatting:

%{optional_re} => Re: (applicable if the post is a Reply)

%{site_name} => [Discourse Meta]

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

%{topic_title} => Show categories in e-mail notifications

Currently showing the category in email subject is not supported but I’m on it, and will create a separate howto for this once this feature is implemented.

8 Likes

Oh, I was confused a bit, I didn’t realize you were outputting examples for this post, and since the output of %{topic_title} is “Show categories in e-mail notifications”, for a second, I thought the feature was actually done.

Let me know if there’s anything I can do to help, getting that done ASAP would be super helpful, since the anvil’s already hot over at Canonical…

3 Likes

“Subject format for standard emails.”

^^^ That is terrible. Can you look at amending that so it either explains all the magic or links to a meta topic that explains that.

2 Likes

Sent a PR for this feature:

4 Likes

Notwithstanding the ambiguous “Subject format for standard emails” tip beneath the text field, this is still a bit ambiguous.

It would seem that %{site_name}, %{optional_re}, and %{topic_title} do not include square brackets but %{optional_pm} does. Is that correct? And what about the new (as of yet undocumented) %{optional_cat}? And are spaces not necessary?

Just posted a howto for this feature:

4 Likes

Hey @nukeador, has anyone had a chance to try out the new notifications on https://discourse.mozilla-community.org/ yet? It’s working pretty well for us so far and just wanted to follow up with at least one other group of mailing list users.

Yes, we are using it right now and it’s working great :smiley:

Next improvement would be to have also better email headers for Lists so clients would be able to identify messages as coming from a mailing list.

FWIW, there is a site setting email custom headers that we’ve added the following:

Auto-Submitted: auto-generated|Precedence: list|List-Id: <FROM-ADDRESS.example.org>|List-Unsubscribe: <https://site.example.org.org/user_preferences>

Where FROM-ADDRESS.example.org corresponds to our fromaddress@example.org that emails are sent from. Granted, that causes all Discourse notifications to have the same List-Id, but it’s good enough for filters if you add in the subject line. It’d be nice if there were a way to have different headers for reply notifications, such as Auto-Submitted: auto-replied, but maybe that will come in time.

We also took the site name out of the email subject, i.e.:

%{optional_re}%{optional_pm}%{optional_cat}%{topic_title}

… which makes it look pretty much like a traditional mailing list subject line.

The email headers already include these list meta fields. Can you view source and specify exactly what you mean?

@codinghorror I’m not sure about @nukeador but my concern with the default headers currently in place is that a new List-Id is generated for each topic, which makes it impossible for users to create filters based on that List-Id:

List-Unsubscribe: <https://discourse.example.org/my/preferences>
Auto-Submitted: auto-generated
List-Id: <topic.618.discourse.example.org>
List-Archive: https://discourse.example.org/t/some-topic/618

Ideal usefulness:
List-Id: <category.discourse.example.org>

Next useful:
List-Id: <discourse.example.org>

Least useful:
List-Id: <topic.618.discourse.example.org>

1 Like

You are both right, I didn’t see that. And yes, list-id should be the category instead of the topic number to be useful for filtering.

1 Like

Ok, @techapj can you make that change to include category / subcategory there as indicated?

Also, IMHO, Precedence: list needs to be in there as well as a default. Without that, we get “out of office” bounce-backs that turn into uncategorized topics on our Discourse site. :slight_smile:

Where is that header documented? @techapj fine to add that header, but maybe not for things like email confirmation of accounts, etc.

http://tools.ietf.org/html/rfc3834 in section 3.1.8. It’s interesting, because I just took it out a short while ago when I saw those other headers were now standard. It wasn’t an hour passed that I got an Outlook-generated OOO message responding to a digest, with someone’s phone number posted to our Discourse site. :smile:

(So I put it back in, for now.)

Good to know, I wasn’t aware of that one. We’ll add it!

1 Like
3 Likes