diff --git a/app/mailers/user_notifications.rb b/app/mailers/user_notifications.rb index bf39562d4d7..df00b71c4c3 100644 --- a/app/mailers/user_notifications.rb +++ b/app/mailers/user_notifications.rb @@ -76,7 +76,8 @@ class UserNotifications < ActionMailer::Base # If we have a display name, change the from address if username.present? - email_opts[:from] = "\"#{username} @ #{SiteSetting.title}\" <#{SiteSetting.notification_email}>" + aliased = I18n.t(:via, username: username, site_name: SiteSetting.title) + email_opts[:from] = "#{aliased} <#{SiteSetting.notification_email}>" end email = build_email user.email, "user_notifications.user_#{notification_type}", email_opts diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 2de3cdd9657..02e1133080b 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -2,6 +2,7 @@ en: title: "Discourse" topics: "Topics" + via: "%{username} via %{site_name}" is_reserved: "is reserved" too_many_mentions: "has too many users mentioned" too_many_images: "has too many images" diff --git a/spec/mailers/user_notifications_spec.rb b/spec/mailers/user_notifications_spec.rb index 984c21118e3..d13db3e5142 100644 --- a/spec/mailers/user_notifications_spec.rb +++ b/spec/mailers/user_notifications_spec.rb @@ -57,7 +57,7 @@ describe UserNotifications do its(:from) { should == [SiteSetting.notification_email] } it "should have the correct from address" do - subject.header['from'].to_s.should == "\"#{username} @ #{SiteSetting.title}\" <#{SiteSetting.notification_email}>" + subject.header['from'].to_s.should == "#{username} via #{SiteSetting.title} <#{SiteSetting.notification_email}>" end