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
|
||||
|
||||
def default_headers
|
||||
headers = {
|
||||
from: "\"#{AppConfig.settings.pod_name}\" <#{AppConfig.mail.sender_address}>",
|
||||
host: "#{AppConfig.pod_uri.host}",
|
||||
from_name = AppConfig.settings.pod_name
|
||||
from_name += " (#{@sender.profile.full_name.empty? ? @sender.username : @sender.name})" if @sender.present?
|
||||
|
||||
{
|
||||
from: name_and_address(from_name, AppConfig.mail.sender_address),
|
||||
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
|
||||
|
||||
def with_recipient_locale(&block)
|
||||
|
|
|
|||
Loading…
Reference in a new issue