mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +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:
@ -200,6 +200,7 @@ RSpec.describe UserNotifications do
|
||||
expect(email.html_part.body.to_s).to be_present
|
||||
expect(email.text_part.body.to_s).to be_present
|
||||
expect(email.header["List-Unsubscribe"].to_s).to match(/\/email\/unsubscribe\/\h{64}/)
|
||||
expect(email.header["List-Unsubscribe-Post"].to_s).to eq("List-Unsubscribe=One-Click")
|
||||
expect(email.header["X-Discourse-Topic-Ids"].to_s).to eq(
|
||||
"#{another_popular_topic.id},#{popular_topic.id}",
|
||||
)
|
||||
@ -437,6 +438,7 @@ RSpec.describe UserNotifications do
|
||||
expect(email.header["List-Unsubscribe"].to_s).to match(
|
||||
/http:\/\/test.localhost\/forum\/email\/unsubscribe\/\h{64}/,
|
||||
)
|
||||
expect(email.header["List-Unsubscribe-Post"].to_s).to eq("List-Unsubscribe=One-Click")
|
||||
|
||||
topic_url = "http://test.localhost/forum/t/#{popular_topic.slug}/#{popular_topic.id}"
|
||||
expect(html).to include(topic_url)
|
||||
|
Reference in New Issue
Block a user