You are here

function simplenews_save_spool in Simplenews 6.2

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

Save mail message in mail cache table.

Parameters

array $message data array to be stored: $message['mail'] $message['nid'] $message['vid'] $message['tid'] $message['status'] (Default: 1 = pending) $message['time'] (default: current unix timestamp)

array $message Mail message array:

1 call to simplenews_save_spool()
simplenews_send_node in includes/simplenews.mail.inc
Send newsletter node to subscribers.

File

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

Code

function simplenews_save_spool($message) {
  $status = isset($message['status']) ? $message['status'] : SIMPLENEWS_SPOOL_PENDING;
  $time = isset($message['time']) ? $message['time'] : time();
  db_query("\n    INSERT INTO {simplenews_mail_spool}\n      (mail, nid, vid, tid, status, timestamp)\n    VALUES ('%s', %d, %d, %d, %d, %d)", $message['mail'], $message['nid'], $message['vid'], $message['tid'], $status, $time);
}