Fix escaping of names in the from header
This commit is contained in:
parent
f76a8d7deb
commit
6cea355636
1 changed files with 5 additions and 8 deletions
|
|
@ -35,16 +35,13 @@ module NotificationMailers
|
||||||
private
|
private
|
||||||
|
|
||||||
def default_headers
|
def default_headers
|
||||||
headers = {
|
from_name = AppConfig.settings.pod_name
|
||||||
from: "\"#{AppConfig.settings.pod_name}\" <#{AppConfig.mail.sender_address}>",
|
from_name += " (#{@sender.profile.full_name.empty? ? @sender.username : @sender.name})" if @sender.present?
|
||||||
host: "#{AppConfig.pod_uri.host}",
|
|
||||||
|
{
|
||||||
|
from: name_and_address(from_name, AppConfig.mail.sender_address),
|
||||||
to: name_and_address(@recipient.name, @recipient.email)
|
to: name_and_address(@recipient.name, @recipient.email)
|
||||||
}
|
}
|
||||||
return headers if @sender.blank?
|
|
||||||
sender_in_header = @sender.profile.full_name.empty? ? @sender.username : @sender.name
|
|
||||||
headers[:from] = "\"#{AppConfig.settings.pod_name} (#{sender_in_header})\" <#{AppConfig.mail.sender_address}>"
|
|
||||||
|
|
||||||
headers
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def with_recipient_locale(&block)
|
def with_recipient_locale(&block)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue