Should any email subjects from discourse not be tagged?

(Allen - Watchman Monitoring) #1

Another change I make in the server.en.yml is unifying all the subject lines.

Many have the [%{site_name}] prefix, and many don’t.

discourse/server.en.yml at master · discourse/discourse · GitHub
discourse/server.en.yml at master · discourse/discourse · GitHub

I can see a school of thought that every email should have the same [prefix] and another school of though that all messages should be prefixed, administrative emails should not be. I’m strongly for tagging all emails.

Could we hear the discourse core team’s take on subject lines?

Feature the related anchor in github URLs with only one line?
Customize all text in Discourse
(Michael Downey) #2

Depending on how this one gets implemented, it might be possible to customize what’s prepended all together, even if it’s nothing at all:

(Jeff Atwood) #3

Is this still an issue? I think you decided the password reset, etc, emails should not have this apply. And I know we fixed digests to use the specified site name or the override email name.

(Allen - Watchman Monitoring) #4

I think I did conclude that I wouldn’t want the administrative emails [Subject line tagged] but then I think discourse did add those, and i’m still on the fence as to which way is “best”. I know I was looking for someone other group(maybe an rfc?) to say “here’s how it should be done”.

In the end, it’s hard to tell what discourse is using where, see

and I still just edit server.en.yml on every upgrade until I can make a clean request here on meta for what should be changed and where.

(Mittineague) #5

Why not just do it once?
eg. create a plugin “custom-text”
In it’s config/locales/server.en.yml file

# custom-text

      title: "Threads"
      yaxis: "Number of new Threads"

results in

Untested, but I think similar would work for other simple text values that are for display only and are not used elsewhere in the code

(Kane York) #6

That has to work for every text value, otherwise Chinese/Turkish etc wouldn’t work.

(Allen - Watchman Monitoring) #7

So back on topic, let’s look at this file:

discourse/server.en.yml at v1.4.0.beta1 · discourse/discourse · GitHub

There are a number of subject_template lines… 55 by my count.

I see at the beginning of many [%{site_name}] but not all of them. That’s pretty much the start of my OP here.

For starters I can’t tell just where %{site_name} comes from. I would think it comes from email_prefix but it doesn’t seem to.


But, let’s say it does, it’s not being used consistently. I’ve taken the time to gather all subjects from server.en.yml, time for a spring cleaning!

the first thing I need to ask is about the word “the” here

Line 1295: “%{invitee_name} invited you to ‘%{topic_title}’ on %{site_domain_name}”

Is there a reason there’s not the word “the” here?
I’m proposing we add it in PR #3532

With that out of the way, here are the subjects, and the next thing to do is decide … we just put ``[%{site_name}]` in front of all of them? and if not, what class of email shouldn’t get it?

Line 1295:    "%{invitee_name} invited you to '%{topic_title}' on %{site_domain_name}"
Line 1314:    "%{invitee_name} invited you to join %{site_domain_name}"
Line 1329:    "Set password for your %{site_name} account"
Line 1339:    "[%{site_name}] Email Deliverability Test"
Line 1379:    "[%{site_name}] New Discourse version, update available"
Line 1395:    "[%{site_name}] update available"
Line 1422:    "1 flag waiting to be handled"
Line 1423:    "%{count} flags waiting to be handled"
Line 1442:    "Post hidden due to community flagging"
Line 1529:    "Welcome to %{site_name}!"
Line 1542:    "Welcome to %{site_name}!"
Line 1565:    "Backup completed successfully"
Line 1571:    "Backup failed"
Line 1582:    "Restore completed successfully"
Line 1586:    "Restore failed"
Line 1597:    "Bulk user invite processed successfully"
Line 1601:    "Bulk user invite processed with errors"
Line 1612:    "Data export complete"
Line 1621:    "Data export failed"
Line 1625:    "[%{site_name}] Email issue -- Insufficient Trust Level"
Line 1632:    "[%{site_name}] Email issue -- Unknown Account"
Line 1639:    "[%{site_name}] Email issue -- No Content"
Line 1648:    "[%{site_name}] Email issue -- Content unrecognized"
Line 1655:    "[%{site_name}] Email issue -- Invalid Access"
Line 1662:    "[%{site_name}] Email issue -- Posting error"
Line 1669:    "[%{site_name}] Email issue -- Posting error"
Line 1680:    "[%{site_name}] Email issue -- Unknown Reply Key"
Line 1687:    "[%{site_name}] Email issue -- Unknown To: Address"
Line 1694:    "[%{site_name}] Email issue -- Topic Not Found"
Line 1701:    "[%{site_name}] Email issue -- Topic Closed"
Line 1708:    "[%{site_name}] Email issue -- Auto Generated Reply"
Line 1715:    "[%{site_name}] Email issue -- POP authentication error"
Line 1722:    "New account blocked"
Line 1733:    "Account blocked"
Line 1742:    "New user %{username} blocked due to community flags"
Line 1753:    "New user %{username} posts blocked due to repeated links"
Line 1764:    "Account unblocked"
Line 1774:    "1 user waiting for approval"
Line 1775:    "%{count} users waiting for approval"
Line 1782:    "Downloading remote images disabled"
Line 1802:    "[%{site_name}] %{username} invited you to a message '%{topic_title}'"
Line 1818:    "[%{site_name}] %{username} invited you to a topic '%{topic_title}'"
Line 1834:    "[%{site_name}] %{topic_title}"
Line 1844:    "[%{site_name}] %{topic_title}"
Line 1854:    "[%{site_name}] %{topic_title}"
Line 1864:    "[%{site_name}] %{topic_title}"
Line 1874:    "[%{site_name}] [PM] %{topic_title}"
Line 1885:    "[%{site_name}] Digest"
Line 1897:    "[%{site_name}] Password reset"
Line 1907:    "[%{site_name}] Set Password"
Line 1917:    "[%{site_name}] Login"
Line 1927:    "[%{site_name}] Your New Account"
Line 1935:    "[%{site_name}] Confirm your new email address"
Line 1942:    "You've been approved on %{site_name}!"
Line 1962:    "[%{site_name}] Activate your new account"

Overriding strings in server.xx.yml?
(Mittineague) #8

It comes from the site_settings table
site_name: SiteSetting.title

(Allen - Watchman Monitoring) #9

Post a picture of that from the admin please… because everything matches that just a little bit.

(Mittineague) #10

Well, there sure are a lot of title: s
In this case the default comes from server.en.yml

    short_date_no_year: "D MMM"
    short_date: "D MMM, YYYY"
    long_date: "MMMM D, YYYY h:mma"

  datetime: &datetime
      [~, January, February, March, April, May, June, July, August, September, October, November, December]
      short: "%m-%d-%Y"
      short_no_year: "%B %-d"
      date_only: "%B %-d, %Y"
    <<: *datetime
    <<: *datetime

  title: "Discourse"
  topics: "Topics"
  posts: "posts"
  loading: "Loading"
  powered_by_html: 'Powered by <a href="">Discourse</a>, best viewed with JavaScript enabled'
  log_in: "Log In"

But can be changed in the ACP

(Allen - Watchman Monitoring) #11

Maybe, it’s to be determined.

I’ll know more once this topic is fully resolved. At present, it appears that the field used for the subject line is also being used in the body of emails, which is not expected. So I just replace this all with words of my liking, and it’s fine for now.

(Allen - Watchman Monitoring) #12

As of

This can be managed by any Discourse admin on their own install


(Erlend Sogge Heggen) closed #13