set 'List-Unsubscribe' email header to new unsubscribe url instead of user preferences url

This commit is contained in:
Régis Hanol 2016-07-13 22:32:46 +02:00
parent b8261a662b
commit 926c021125
1 changed files with 3 additions and 2 deletions

View File

@ -132,10 +132,11 @@ module Email
def header_args
result = {}
if @opts[:add_unsubscribe_link]
result['List-Unsubscribe'] = "<#{template_args[:user_preferences_url]}>"
unsubscribe_url = @template_args[:unsubscribe_url].presence || @template_args[:user_preferences_url]
result['List-Unsubscribe'] = "<#{unsubscribe_url}>"
end
result['X-Discourse-Post-Id'] = @opts[:post_id].to_s if @opts[:post_id]
result['X-Discourse-Post-Id'] = @opts[:post_id].to_s if @opts[:post_id]
result['X-Discourse-Topic-Id'] = @opts[:topic_id].to_s if @opts[:topic_id]
if allow_reply_by_email?