You are here

function simplenews_update_spool in Simplenews 6

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

Update status of mail data in spool table.

Time stamp is set to current time.

Parameters

array $msids: Mail spool id of record to be updated

array $result: Array containing email sent result 'status' => (0 = hold, 1 = pending, 2 = send) 'error' => error id (optional; defaults to '')

1 call to simplenews_update_spool()
simplenews_mail_spool in ./simplenews.module
Send simplenews newsletters from the spool.

File

./simplenews.module, line 1899
Simplnews node handling, sent email, newsletter block and general hooks

Code

function simplenews_update_spool($msids, $result) {
  $params[] = $result['status'];
  $params[] = isset($result['error']) ? $result['error'] : FALSE;
  $params[] = time();
  $params = array_merge($params, $msids);
  db_query("UPDATE {simplenews_mail_spool} SET status = %d, error = %d, timestamp = %d WHERE msid IN(" . db_placeholders($msids, 'int') . ")", $params);
}