Marcos Aguayo
Marcos Aguayo

Reputation: 7200

Change all merge tags of a list in MailChimp

I'm using the API v3 of MailChimp to send emails. I have around 10.000 subscribers in my list, and I want to change all MERGE TAGS. The way I'm doing it right now is, getting the List ID. Get all the emails of that list, and go one by one updating the field.

It takes 2 hours to change them all. Is there a way to update all of them?

I'm updating them right now this way: http://developer.mailchimp.com/documentation/mailchimp/reference/lists/members/#

Upvotes: 1

Views: 1127

Answers (1)

ctorrez04
ctorrez04

Reputation: 101

Probably is too late for this answer but,

Mailchimp API V3.0 use batch operations now

You could save different operations of this type in an array

operation = {
   method : 'put',
   path : '/lists/'+list.id+"/members/"+hashEmail,
   body : {
       FNAME: "Jhonny", 
       LNAME: "Bravo" , 
   }
}

batchOperations.push(operation);

operation = {
   method : 'patch',
   path : '/lists/'+list.id+"merge-fields/" + merge_id
   body : {
          tag : field.tag,
          name : field.name,
          type : "text",
          public : false,
          default_value : ""
   }
}
batchOperations.push(operation);

and send a POST request to /3.0/batches

 request = {
    method : 'post',
    path : '/3.0/batches',
    body : {
       operations : batchOperations  
    }
 }

More info about Mailchimp's batch operations here http://developer.mailchimp.com/documentation/mailchimp/guides/how-to-use-batch-operations/

Upvotes: 3

Related Questions