Email subject formatter per-category?

Ok, this is probably a strange request, so I’ll explain my dilemma here.

We’ve got a Discourse instance that has lots of users, and by virtue of being built on two decades of mailing list before, we’ve got a lot of mailing list mode users.

We currently have a few active categories, but we do not use the category name in the email subject format, since all our mailing list people have years of emails that start with an [SDL] slug and mail filters that sort email into folders based on that string, etc.

So our format string looks like this, with the hardcoded [SDL]

%{optional_re}[SDL]%{optional_pm} %{topic_title}

…and this has been fine for three years now.

But now we’re moving a crusty old mailing list that logs commits to our revision control to a Discourse category, for all the good benefits Discourse offers over crusty old mailing lists, and now we have a problem, because that mailing list had a different slug ([Commits], of course).

So now I need something in that subject format string that is unique to the category that I can use for the slug, instead of the hardcoded [SDL] string.

I can’t use the existing category-slug string, because most of the categories would need to use the same string, and even if they don’t have to be unique, (I assume that) it’ll break all existing URLs to our forums if I change them. Can’t use the category name either, because most of them just need to be [SDL] and they’re too-large phrases in any case.

Is there something I can use for this? Failing that, can we add a generic string to the per-category settings that is accessible to the email subject format string, the same way that %{optional_cat} is? Like, a %{cat_mailsubj} that defaults to an empty string?


EDIT: apparently I came around to this in 2017, too: How to properly alter the database? - #8 by icculus …is there a better option, or should I dust this patch off again?


Hmm this is tricky. Can you provide some specific examples for us to mull over?

The “Commits” list is one, but we have other ones, too: a mailing list that alerts everytime buildbot fails for some target or another, and other automated notices like this that often just need to be noticed but occasionally need a little conversation specific to the topic. Moving these off decrepit mailing lists and onto Discourse eliminates a ton of UI friction and unreliability, even when most users will continue to interact with them almost exclusively through an email client.

For these things, it’s just a cultural difference between what people expect in a web interface (A category called “SDL Buildbot Failure Notifications” that you click into and see specific topics) vs email subject lines prefixes ("[BUILDBOT-SDL]") on every topic. It seems worth adding an extra string to the category-specific settings for this.

1 Like