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'
}
}