From 362adb0498571d01bda93ec99bca7f0fa0c87df0 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Wed, 9 Jul 2014 16:44:08 -0400 Subject: [PATCH] FIX: add site setting email_site_title, which overrides title in reply by email address in case the title has invalid characters --- config/locales/server.en.yml | 1 + config/site_settings.yml | 1 + lib/email/message_builder.rb | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 2c2c42bc523..4b4cb07dcdc 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -881,6 +881,7 @@ en: email_in_min_trust: "The minimum trust level an users needs to have to be allowed to post new topics via email" email_in_category: "The category new emails are posted into" email_prefix: "The [label] used in the subject of emails. It will default to 'title' if not set" + email_site_title: "The title of the site used as the sender of emails from the site. Default to 'title' if not set. If your 'title' contains characters that are not allowed in email sender strings, use this setting." minimum_topics_similar: "How many topics need to exist in the database before similar topics are presented." diff --git a/config/site_settings.yml b/config/site_settings.yml index 1f888fd7502..78ef03d90be 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -385,6 +385,7 @@ email: enum: 'MinTrustToCreateTopicSetting' email_in_category: -1 email_prefix: '' + email_site_title: '' files: max_image_size_kb: diff --git a/lib/email/message_builder.rb b/lib/email/message_builder.rb index 6ed3df263bc..7b32dac926d 100644 --- a/lib/email/message_builder.rb +++ b/lib/email/message_builder.rb @@ -168,7 +168,7 @@ module Email end def site_alias_email(source) - "#{SiteSetting.title} <#{source}>" + "#{SiteSetting.email_site_title.presence || SiteSetting.title} <#{source}>" end end