You are here

function simplenews_clear_spool in Simplenews 6

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

Remove records from mail spool table.

All records with status 'send' and time stamp before the expiration date are removed from the spool.

2 calls to simplenews_clear_spool()
simplenews_cron in ./simplenews.module
Implementation of hook_cron().
simplenews_send_node in ./simplenews.module
Send newsletter node to subcribers.

File

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

Code

function simplenews_clear_spool() {
  $expiration_time = time() - variable_get('simplenews_spool_expire', 0) * 86400;
  db_query("DELETE FROM {simplenews_mail_spool} WHERE status = %d AND timestamp <= %d", SIMPLENEWS_SPOOL_DONE, $expiration_time);
}