You are here

function simplenews_update_spool in Simplenews 6.2

Same name and namespace in other branches
  1. 6 simplenews.module \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' => SIMPLENEWS_SPOOL_HOLD, _PENDING, _DONE, _IN_PROGRESS 'error' => error id (optional; defaults to '')

2 calls to simplenews_update_spool()
simplenews_get_spool in includes/simplenews.mail.inc
This function allocates messages to be sent in current run.
simplenews_mail_spool in includes/simplenews.mail.inc
Send simplenews newsletters from the spool.

File

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

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("\n    UPDATE {simplenews_mail_spool}\n    SET status = %d,\n      error = %d,\n      timestamp = %d\n    WHERE msid IN(" . db_placeholders($msids, 'int') . ")", $params);
}