Skip to content

Commit

Permalink
Fixed header [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Jan 14, 2024
1 parent 0192c10 commit 5bcba4a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ For one-click unsubscribe headers ([RFC 8058](https://datatracker.ietf.org/doc/h

```ruby
headers["List-Unsubscribe-Post"] = "List-Unsubscribe=One-Click"
headers["List-Unsubscribe"] = mailkick_unsubscribe_url(@user, "sales")
headers["List-Unsubscribe"] = "<#{mailkick_unsubscribe_url(@user, "sales")}>"
```

## Bounces and Spam Reports
Expand Down
2 changes: 1 addition & 1 deletion test/controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_unsubscribe_header
user = User.create!
user.subscribe("sales")
message = UserMailer.with(user: user).welcome.deliver_now
url = message["List-Unsubscribe"].to_s
url = message["List-Unsubscribe"].to_s[1..-2]

post url, headers: {"List-Unsubscribe" => "One-Click"}
assert_response :success
Expand Down
2 changes: 1 addition & 1 deletion test/internal/app/mailers/user_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class UserMailer < ActionMailer::Base

def welcome
headers["List-Unsubscribe-Post"] = "List-Unsubscribe=One-Click"
headers["List-Unsubscribe"] = mailkick_unsubscribe_url(params[:user], "sales")
headers["List-Unsubscribe"] = "<#{mailkick_unsubscribe_url(params[:user], "sales")}>"
mail to: "test@example.org", subject: "Hello"
end
end

0 comments on commit 5bcba4a

Please sign in to comment.