mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 04:31:10 +08:00
Add custom headers for email messages
See http://meta.discourse.org/t/custom-headers-in-emails-site-settings/7480
This commit is contained in:
@ -75,6 +75,19 @@ module Email
|
||||
result['Reply-To'] = from_value
|
||||
end
|
||||
|
||||
result.merge(MessageBuilder.custom_headers(SiteSetting.email_custom_headers))
|
||||
end
|
||||
|
||||
def self.custom_headers(string)
|
||||
result = {}
|
||||
string.split('|').each { |item|
|
||||
header = item.split(':', 2)
|
||||
if header.length == 2
|
||||
name = header[0].strip
|
||||
value = header[1].strip
|
||||
result[name] = value if name.length > 0 && value.length > 0
|
||||
end
|
||||
}
|
||||
result
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user