You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The unsubscribeAll function currently sends a POST request to the preference center on mozilla.org to unsubscribe users from all newsletters. However, this approach has some limitations and potential issues:
The preference center itself forwards the request to Basket, making this an indirect method.
The preference center recently adopted a js-only implementation for handling this request, which may cause unsubscribeAll to break or behave unpredictably in the future.
Proposed Solution
To ensure future reliability unsubscribeAll should send requests directly to Basket. This is the more direct and stable approach since Basket is the service ultimately handling the unsubscription.
The direct API call would:
POST to https://basket.mozilla.org/news/unsubscribe/<token>/
Include a request body with optout=Y, this is the signal to basket to unsubscribe from ALL newsletters and flags the user as opted out of emails.
Description
The
unsubscribeAll
function currently sends a POST request to the preference center onmozilla.org
to unsubscribe users from all newsletters. However, this approach has some limitations and potential issues:unsubscribeAll
to break or behave unpredictably in the future.Proposed Solution
To ensure future reliability
unsubscribeAll
should send requests directly to Basket. This is the more direct and stable approach since Basket is the service ultimately handling the unsubscription.The direct API call would:
https://basket.mozilla.org/news/unsubscribe/<token>/
optout=Y
, this is the signal to basket to unsubscribe from ALL newsletters and flags the user as opted out of emails.Implementation Example
Here’s how the request could look using
fetch
:┆Issue is synchronized with this Jira Task
The text was updated successfully, but these errors were encountered: