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

View file

@ -132,7 +132,8 @@ module Email
def header_args def header_args
result = {} result = {}
if @opts[:add_unsubscribe_link] 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 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]