Swap out "@" for "via" in email From field

This commit is contained in:
Robin Ward 2013-02-27 19:01:45 -05:00
parent c62729b5b6
commit a086635add
3 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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"

View File

@ -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