PHP wrapper, import and QueueSubscriptionBasedAutoResponders

Hi all, I'm new here, am really enjoying using the API, but have a small problem I wonder if one of you can help with...

I am developing a form that acts as a team signup form. The captain gets subscribed to a list that sends him info on the details of the game, where it is, times etc.

So, I add him using the following:

$wrap = new CS_REST_Subscribers($team_entry_invoice_id, $cm_api_key);
$result = $wrap->add(array(
    'EmailAddress' => $data['captain_email'],
    'Name' => $data['captain_name'],
    'Resubscribe' => true

This works fine, he gets his autoresponder.

The rest of the form ( four more people - team members ) gets subscribed to another, newsletter list.

Like this, using import instead of add:

$wrap = new CS_REST_Subscribers($newletter_id, $cm_api_key);
$result = $wrap->import(array(
        'EmailAddress' => $data['captain_email'],
        'Name' => $data['captain_name']
        'EmailAddress' => $data['player_1_email'],
        'Name' => $data['player_1_name']
        'EmailAddress' => $data['player_2_email'],
        'Name' => $data['player_2_name']
        'EmailAddress' => $data['player_3_email'],
        'Name' => $data['player_3_name']
        'EmailAddress' => $data['player_4_email'],
        'Name' => $data['player_4_name']
), true,true);

Notice the second true in there, more on that later....

They all get subscribed fine, but there are autoresponders that are supposed to go out to everyone don't go out.

That's where the second true comes in, in the docs, I read that if you are using import, you don't get sent autoresponders automatically, but you need to set QueueSubscriptionBasedAutoResponders
to true
, which is what I do with that second true

However, that didn't work, so I went and changed the default in the function in the class, like this:

function import($subscribers, $resubscribe, $queueSubscriptionBasedAutoResponders = true) {
        $subscribers = array(
            'Resubscribe' => $resubscribe,
            'QueueSubscriptionBasedAutoResponders' => $queueSubscriptionBasedAutoResponders,
            'Subscribers' => $subscribers
        return $this->post_request($this->_subscribers_base_route.'/import.json', $subscribers);

And it still didn't work. I'm stuck! Any ideas?


tl;dr: Can't get import to trigger autoresponders even when QueueSubscriptionBasedAutoResponders is set to true.

tobyb tobyb, 4 years ago

Hi gomako,

Just following up here as well. It looks like this was caused by a bug with some date comparisons. We've just made some changes to fix this behaviour so your subscription based autoresponders should be sending.


Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free