From 5180d3e35516a6964c8367d00046931853f736c1 Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Wed, 3 Jun 2015 22:19:51 +0530 Subject: [PATCH] FEATURE: include email_prefix in digest email subject instead of site title --- app/mailers/user_notifications.rb | 2 +- spec/mailers/user_notifications_spec.rb | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/mailers/user_notifications.rb b/app/mailers/user_notifications.rb index 446ac0cd00c..da27294d7f4 100644 --- a/app/mailers/user_notifications.rb +++ b/app/mailers/user_notifications.rb @@ -54,7 +54,7 @@ class UserNotifications < ActionMailer::Base min_date = opts[:since] || @user.last_emailed_at || @user.last_seen_at || 1.month.ago - @site_name = SiteSetting.title + @site_name = SiteSetting.email_prefix.presence || SiteSetting.title @header_color = ColorScheme.hex_for_name('header_background') @last_seen_at = short_date(@user.last_seen_at || @user.created_at) diff --git a/spec/mailers/user_notifications_spec.rb b/spec/mailers/user_notifications_spec.rb index e712fa5bdae..7f55cc198d2 100644 --- a/spec/mailers/user_notifications_spec.rb +++ b/spec/mailers/user_notifications_spec.rb @@ -77,6 +77,13 @@ describe UserNotifications do expect(subject.text_part.body.to_s).to be_present end + it "includes email_prefix in email subject instead of site title" do + SiteSetting.email_prefix = "Try Discourse" + SiteSetting.title = "Discourse Meta" + + expect(subject.subject).to match(/Try Discourse/) + expect(subject.subject).not_to match(/Discourse Meta/) + end end end