Swap out "@" for "via" in email From field
This commit is contained in:
parent
c62729b5b6
commit
a086635add
|
@ -76,7 +76,8 @@ class UserNotifications < ActionMailer::Base
|
||||||
|
|
||||||
# If we have a display name, change the from address
|
# If we have a display name, change the from address
|
||||||
if username.present?
|
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
|
end
|
||||||
|
|
||||||
email = build_email user.email, "user_notifications.user_#{notification_type}", email_opts
|
email = build_email user.email, "user_notifications.user_#{notification_type}", email_opts
|
||||||
|
|
|
@ -2,6 +2,7 @@ en:
|
||||||
title: "Discourse"
|
title: "Discourse"
|
||||||
topics: "Topics"
|
topics: "Topics"
|
||||||
|
|
||||||
|
via: "%{username} via %{site_name}"
|
||||||
is_reserved: "is reserved"
|
is_reserved: "is reserved"
|
||||||
too_many_mentions: "has too many users mentioned"
|
too_many_mentions: "has too many users mentioned"
|
||||||
too_many_images: "has too many images"
|
too_many_images: "has too many images"
|
||||||
|
|
|
@ -57,7 +57,7 @@ describe UserNotifications do
|
||||||
its(:from) { should == [SiteSetting.notification_email] }
|
its(:from) { should == [SiteSetting.notification_email] }
|
||||||
|
|
||||||
it "should have the correct from address" do
|
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
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue