You are here

function drupal_mail_wrapper in Queue Mail 6

Same name and namespace in other branches
  1. 5 queue_mail.inc \drupal_mail_wrapper()

Wrapper function to use job queue

File

./queue_mail.inc, line 6

Code

function drupal_mail_wrapper($message) {
  $pos = strpos(variable_get('queue_mail_keys', ''), $mailkey);
  if (function_exists('job_queue_add') && $pos === FALSE) {
    job_queue_add('queue_mail_send', t('Queued email'), array(
      $message,
    ));
    return t('Email message queued for delivery.');
  }
  else {
    queue_mail_send($message);
    return t('Queuing unavailable. Email sent directly.');
  }
}