mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +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:
@ -335,6 +335,12 @@ RSpec.describe Email::MessageBuilder do
|
||||
expect(message_with_unsubscribe.header_args["List-Unsubscribe"]).to be_present
|
||||
end
|
||||
|
||||
it "has the List-Unsubscribe-Post header" do
|
||||
expect(message_with_unsubscribe.header_args["List-Unsubscribe-Post"]).to eq(
|
||||
"List-Unsubscribe=One-Click",
|
||||
)
|
||||
end
|
||||
|
||||
it "has the unsubscribe url in the body" do
|
||||
expect(message_with_unsubscribe.body).to match("/t/1234/unsubscribe")
|
||||
end
|
||||
|
Reference in New Issue
Block a user