0

I am using Mailchimp API in an application for sending weekly emails to users. The flow is the following: at the begging the list of subscribers is empty, so I make a request to fill it. After filling it, I make another request to create a campaign associated with the list. But when to send it, it says that the campaign is not ready to be sent because the list of subscribers is empty. Indeed, in the Mailchimp web interface the number of subscribers in the list is zero, but when I enter the list, there are subscribers. After a while (several minutes), the number of subscribers gets updated and the campaign can be sent. And it is not about email confirmation because I'm not using Double Opt In.

Does anybody know what am I missing or how long must wait to get the numbers of subscribers to get updated and then to make the request for creating the campaign?

If it does matter I'm using Ruby on Rails and the Gibbon gem.

Here is the method for adding users to list

   def add_subscriber_to_list data, list_id = default_list_id
      Gibbon::Request.new.lists(list_id).members.create(body: data)
   end

where data has the following format

{
    email_address: 'email@test.com',
    status: 'subscribed',
    double_option: false,
    merge_fields: {
      FNAME: 'First name',
      LNAME: 'Last name'
    }
}
Madalina
  • 457
  • 1
  • 5
  • 14
  • You need to be more descriptive. Obviously, your `#upsert` call for adding subscribers isn't working correctly. Please post any code you have for the sake of everyone trying to help you. – Collin Graves May 27 '16 at 15:46
  • You empty your list of subscribers every week? – TooMuchPete May 27 '16 at 19:11
  • @TooMuchPete, yes I empty the list of subscribers after I sent the campaign – Madalina May 29 '16 at 19:43
  • @CollinGraves I added some code. I tried the same request with CURL, but the same problem: members are added to list, but the number of subscribers remains 0 for several minutes, then it gets updated. – Madalina May 29 '16 at 19:53
  • The easiest solution to this is probably not to do that, tbh. Just remove the people who need to be removed, add the new people. Also be aware that this has the potential to look spammy if you're not properly tracking MC unsubs. – TooMuchPete May 30 '16 at 20:44

0 Answers0