Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MailChimp resubscribe a deleted member causes the API to return a 400 bad request

I've encountered a problem on MailChimp v3 API where it responds with a status 400 when I try to resubcribe a member. Here's the steps to reproduce the problem:

  1. Subscribe a member to a list then delete that member.
  2. Resubscribe using the API through endpoint PUT /lists/{list_id}/members/{subscriber_hash} returns a status 400

    { 'type': 'http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/', 'title': 'Forgotten Email Not Subscribed', 'status': 400, 'detail': '[email protected] was permanently deleted and cannot be re-imported. The contact must re-subscribe to get back on the list.' }

and the request is:

{   email_address: '[email protected]',   status_if_new: 'subscribed' } 

Based on the response the solution is the member must be resubscribed which I'm actually trying to do. Anyone encountered this problem?

like image 588
JohnnyQ Avatar asked Sep 06 '18 07:09

JohnnyQ


People also ask

Were permanently deleted from this audience and could not be imported Mailchimp?

The message comes from Mailchimp. It means that you tried to re-subscribe a deleted contact. A deleted or unsubscribed contact should be able to re-subscribe but they need to do it themselves.


2 Answers

I've contact MC support and this is what they gave me:

Due to the GDPR requirements for EU, we recently added a new way to delete contacts from your list. At this time, you can delete and archive (which is a soft delete and keeps that contact in your reports) or you can delete and remove (which is a hard delete and removes those contacts from all reporting / etc). Seeing this error message means you are trying to re-add someone that had been previously permanently deleted. If you intend to delete someone and re-add them via the API, you want to use the delete and archive option.

The only confusing part for me was that I was asked to resubscribe when in fact it was the very thing I was doing, but the support team also told me that:

When seeing the message for 'resubscribe', this is referring to using a MailChimp signup form as opposed to using an API subscribe method. The MailChimp forms are the ultimate 'workaround' in which it can be used to resubscribe unsubscribers, cleaned addresses or permanently deleted addresses.

In summary, there is nothing wrong the code it's just how MC treats that request from their API which I believe shouldn't be as misleading as the error message says.

So there you go, I hope this helps someone who's been in the same painful path of discovering that there's nothing wrong with your code and that was just simply how their API worked. ¯_(ツ)_/¯

like image 72
JohnnyQ Avatar answered Sep 22 '22 20:09

JohnnyQ


There is exist the way to re-subscribe permanently deleted contacts. Mailchimp offers 2 ways: 1) via re-subcription using their form 2) via deleting the Audience

You can delete the entire audience as a whole, then create a brand new audience, and re import.

Here is the info from Mailchimp's knowledge base:

If all of your contacts were deleted and need to be re-imported, it is possible to delete the entire audience, then create a new audience, and re-import. These steps are to delete the audience container where contacts are stored so deleted contacts can be re added. This is only recommended when all contacts on the audience need to be deleted or have been deleted. Deleting the entire audience will result in a loss of activity for all contacts on the audience. If click, open, and other activity exists on the audience, this will be lost.

To permanently delete the entire audience: 1️⃣Navigate to the Audience tab. 2️⃣Click ‘Manage Audience’ and select ‘View Audiences’. 3️⃣Check the box next to the audience name and click ‘Delete’.

If you have sent to your audience in the last 7 days, you will need to wait that time period before being able to delete the audience. If you do not want to wait 7 days, the only other option is signing those subscribers up through the hosted signup form.

like image 22
DmitryK Avatar answered Sep 20 '22 20:09

DmitryK