Option to change the email subject prefix

It adds a new setting 'email_prefix' to configure which [label] will be used in the subject of emails. Discourse currently uses '[title]'. The problem is that sometimes you need to set a longer title, that doesn't really work well for emails. I think this is very common since the HTML `<title>` tag is very important for SEO.

It will default to '[title]' if this setting is not used.

See: https://meta.discourse.org/t/where-to-change-the-email-subject-prefix/11989
This commit is contained in:
Jorge Manrubia
2014-03-26 23:06:00 +01:00
parent 764ba152d1
commit 806924dd7e
4 changed files with 9 additions and 3 deletions

View File

@ -145,10 +145,15 @@ describe Email::MessageBuilder do
context "template_args" do
let(:template_args) { builder.template_args }
it "has the site name" do
it "has the site name as the site title when `SiteSetting.email_prefix` is not set" do
expect(template_args[:site_name]).to eq(SiteSetting.title)
end
it "has the site name as SiteSetting.email_prefix when it is set" do
SiteSetting.email_prefix = 'some email prefix'
expect(template_args[:site_name]).to eq(SiteSetting.email_prefix)
end
it "has the base url" do
expect(template_args[:base_url]).to eq(Discourse.base_url)
end