mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 01:31:35 +08:00
FEATURE: add support for One-Click unsubscribe (RFC 8058)
We were missing the "List-Unsubscribe-Post" header in emails we sent to allow Yahoo / GMail and others to automagically show a link to unsubscribe. Internal ref - t/144713
This commit is contained in:
@ -223,10 +223,14 @@ module Email
|
||||
|
||||
def header_args
|
||||
result = {}
|
||||
|
||||
if @opts[:add_unsubscribe_link]
|
||||
unsubscribe_url =
|
||||
@template_args[:unsubscribe_url].presence || @template_args[:user_preferences_url]
|
||||
result["List-Unsubscribe"] = "<#{unsubscribe_url}>"
|
||||
if unsubscribe_url = @template_args[:unsubscribe_url].presence
|
||||
result["List-Unsubscribe"] = "<#{unsubscribe_url}>"
|
||||
result["List-Unsubscribe-Post"] = "List-Unsubscribe=One-Click"
|
||||
else
|
||||
result["List-Unsubscribe"] = "<#{@template_args[:user_preferences_url]}>"
|
||||
end
|
||||
end
|
||||
|
||||
result["X-Discourse-Post-Id"] = @opts[:post_id].to_s if @opts[:post_id]
|
||||
|
Reference in New Issue
Block a user