When someone tries to re-subscribe using the form, the request fails if the email already exists in Mailchimp with the status "unsubscribed".
Right now, the API is using POST /lists/{list_id}/members, which only works for new contacts.
If the email is already in the members list, Mailchimp returns this error:
400: is already a list member. Use PUT to insert or update list members.
We should update the logic to use a PUT request to modify the existing member and mark them as "subscribed" or "pending" (double opt-in).
Note that if the user was permanently deleted from the list (not just unsubscribed), Mailchimp doesn't allow them to be added again via the API. In that case, they have to re-subscribe manually through a Mailchimp signup form. That's a limitation on Mailchimp's side: https://mailchimp.com/help/delete-contacts/
When someone tries to re-subscribe using the form, the request fails if the email already exists in Mailchimp with the status "unsubscribed".
Right now, the API is using
POST /lists/{list_id}/members, which only works for new contacts.If the email is already in the members list, Mailchimp returns this error:
400: is already a list member. Use PUT to insert or update list members.We should update the logic to use a
PUTrequest to modify the existing member and mark them as "subscribed" or "pending" (double opt-in).Note that if the user was permanently deleted from the list (not just unsubscribed), Mailchimp doesn't allow them to be added again via the API. In that case, they have to re-subscribe manually through a Mailchimp signup form. That's a limitation on Mailchimp's side: https://mailchimp.com/help/delete-contacts/