You are here

function campaignmonitor_addto_queue in Campaign Monitor 8

Adds a CampaignMonitor subscription task to the queue.

Parameters

string $function: The name of the function the queue runner should call.

array $args: The list of args to pass to the function.

Return value

mixed Unique ID if item is successfully added to the queue, FALSE otherwise.

2 calls to campaignmonitor_addto_queue()
campaignmonitor_subscribe in ./campaignmonitor.module
Subscribe a user to a CampaignMonitor list in real time or by adding to the queue.
campaignmonitor_unsubscribe in ./campaignmonitor.module
Unsubscribes a member from a CampaignMonitor list.

File

./campaignmonitor.module, line 443
Module that plugs in Campaign Monitor functionality to your Drupal web site. For Campaign Monitor information see: http://www.campaignmonitor.com/.

Code

function campaignmonitor_addto_queue($function, $args) {
  $queue = \Drupal::queue(CAMPAIGNMONITOR_QUEUE_CRON);
  $queue
    ->createQueue();
  return $queue
    ->createItem([
    'function' => $function,
    'args' => $args,
  ]);
}