function simplenews_save_spool in Simplenews 7
Same name and namespace in other branches
- 6.2 includes/simplenews.mail.inc \simplenews_save_spool()
- 6 simplenews.module \simplenews_save_spool()
- 7.2 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:
- nid
- tid
- status: (optional) Defaults to SIMPLENEWS_SPOOL_PENDING
- time: (optional) Defaults to REQUEST_TIME.
Related topics
File
- includes/
simplenews.mail.inc, line 330 - 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();
}