You are here

function simplenews_save_spool in Simplenews 7.2

Same name and namespace in other branches
  1. 6.2 includes/simplenews.mail.inc \simplenews_save_spool()
  2. 6 simplenews.module \simplenews_save_spool()
  3. 7 includes/simplenews.mail.inc \simplenews_save_spool()

Save mail message in mail cache table.

Parameters

array $spool: The message to be stored in the spool table, as an array containing the following keys:

Related topics

File

includes/simplenews.mail.inc, line 335
Simplenews email send and spool handling

Code

function simplenews_save_spool($spool) {
  $status = isset($spool['status']) ? $spool['status'] : SIMPLENEWS_SPOOL_PENDING;
  $time = isset($spool['time']) ? $spool['time'] : REQUEST_TIME;
  db_insert('simplenews_mail_spool')
    ->fields(array(
    'mail' => $spool['mail'],
    'nid' => $spool['nid'],
    'tid' => $spool['tid'],
    'snid' => $spool['snid'],
    'status' => $status,
    'timestamp' => $time,
    'data' => serialize($spool['data']),
  ))
    ->execute();
}