feat(newsletter): add List-Unsubscribe headers and RFC 8058 one-click handler - #488
Merged
thisismeonmounteverest merged 1 commit intoAug 31, 2026
Conversation
…T handler Adds bulk-mail headers required by Google/Yahoo since Feb 2024 to all regular newsletter sends: List-Unsubscribe (personalised per recipient using the existing unsubscribe token), List-Unsubscribe-Post for Gmail's one-click unsubscribe button, and Precedence: bulk. Transactional sends (reminder, suspension, TOU) are excluded. Also handles RFC 8058 one-click POST requests in SubscriptionController so Gmail's unsubscribe button works without a confirmation page.
thisismeonmounteverest
approved these changes
Aug 31, 2026
thisismeonmounteverest
deleted the
neophytis/newsletter-list-unsubscribe-headers
branch
August 31, 2026 17:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Mailer::sendNewsletterEmail(): now emits three bulk-mail headers on every regular newsletter send:Precedence: bulk— standard signal for mass mailList-Unsubscribe: <https://...>— personalised per recipient using the existing unsubscribe token (required by Google/Yahoo since Feb 2024 for senders over 5,000/day)List-Unsubscribe-Post: List-Unsubscribe=One-Click— enables Gmail's one-click unsubscribe buttonSubscriptionController::unsubscribeNewsletter(): handles RFC 8058 one-click POST requests (bodyList-Unsubscribe=One-Click) sent by Gmail when a user clicks the unsubscribe button, immediately suppressing the address with a 200 response and no confirmation page.Implementation notes
sendTemplateEmail()gains anarray $extraTextHeaders = []parameter (backward-compatible default). A new privatebuildNewsletterHeaders()method constructs the header map, returning empty for transactional types or when no unsubscribe key is present.The unsubscribe URL is generated via the existing
regular_newsletter_unsubscriberoute with the per-recipientunsubscribe_keyalready passed throughSendMassmailCommand.Test plan
List-Unsubscribe,List-Unsubscribe-Post, andPrecedenceappear in raw headersList-Unsubscribe=One-Click; confirm 200 and that the member is unsubscribed