Skip to content

Conversation

@twoleds
Copy link

@twoleds twoleds commented Jan 22, 2024

I would like to add the 'List-Unsubscribe-Post' header to emails according to the RFC8085 standard. I've drafted some code, but I'm unsure whether to send it like this directly or make it configurable in some way. When I looked at the code of the CRM module for the mailer (https://github.com/remp2020/crm-remp-mailer-module/blob/13a06bf1251070fc00a1fae77eb330deb7ad005f/src/Presenters/MailSettingsPresenter.php#L81), it complies with the standard for unsubscribing from newsletters.

More information about the new header:
https://datatracker.ietf.org/doc/html/rfc8058
https://aws.amazon.com/blogs/messaging-and-targeting/an-overview-of-bulk-sender-changes-at-yahoo-gmail/
https://blog.google/products/gmail/gmail-security-authentication-spam-protection/

Gmail’s FAQ and Yahoo’s FAQ both clarify that the one-click unsubscribe requirement will not be enforced until June 2024 as long as the bulk sender has a functional unsubscribe link clearly visible in the footer of each message.

@rootpd
Copy link
Member

rootpd commented Jan 23, 2024

Hi, thanks for the PR.

The change itself sounds reasonable and looks OK to me. If it's used against REMP Mailer module in CRM, it really does what it's supposed to do.

However (as you already mentioned) there needs to be additional level of control for users who have their own CRM, or their own unsubscribe landing page. Those people should enable this only when they're sure, that POST request to their unsubscribe URL actually unsubscribes the user, otherwise they wouldn't do what RFC says.

For example when user clicks our unsubscribe button, we present the message with option to pause their newsletter subscriptions for a month instead of full unsubscribe. User is not unsubscribed right away (not even if it's a POST request). We can't have this header present.

I'd say that this could be a seeded config option, which would be configurable on the /mailer/settings/ page; right next to the default mailer page. We need to:

  • Add new boolean config option in DatabaseSeedCommand.
  • Try to describe the config in the description so user of Mailer understands when it needs to be enabled (unsubscribe URL needs to unsubscribe user if it's requested with POST)
  • Alter the feature in Sender to only add the extra header if the config option was enabled.

If you have more spare time, you can try to add this to the PR. If not, we can take over once we're available 🙂 .

@twoleds
Copy link
Author

twoleds commented Jan 25, 2024

I'll try to play with it.

@twoleds twoleds force-pushed the rfc8058-list-unsubscribe-one-click branch from 25ec8c9 to d2a5838 Compare January 25, 2024 14:21
@twoleds twoleds changed the title Add List-Unsubscribe-Post header to emails, RFC8058 Add support for One-Click unsubscribing according to RFC8058 Jan 25, 2024
@twoleds
Copy link
Author

twoleds commented Jan 25, 2024

I think the operation was successful.

image

I'm not sure if this line will work correctly; I couldn't find the place where the replacement occurs:

$message->setHeader('List-Unsubscribe-Post', '%recipient.list_unsubscribe_post%');

@rootpd
Copy link
Member

rootpd commented Jan 25, 2024

Looks good, we'll test it. Thanks! The "recipient" replacement occurs in Mailgun by Mailgun, we'll test that with our sandbox account, don't worry :).

@rootpd
Copy link
Member

rootpd commented Feb 23, 2024

Hi, this is now merged in the master branch and will be part of the next-week release. Since this is only mirrored repository split from our monorepo, We'll be linking the split commit here next time we split the repository.

Thanks for the contribution! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants