Permalink
Browse files

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

  • Loading branch information...
1 parent c62729b commit a086635addff1234dccb3183932451e0be33fa6e @eviltrout eviltrout committed Feb 28, 2013
Showing with 4 additions and 2 deletions.
  1. +2 −1 app/mailers/user_notifications.rb
  2. +1 −0 config/locales/server.en.yml
  3. +1 −1 spec/mailers/user_notifications_spec.rb
@@ -76,7 +76,8 @@ def notification_template(user, opts)
# 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
@@ -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"
@@ -57,7 +57,7 @@
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

0 comments on commit a086635

Please sign in to comment.