You are here

function simplenews_delete_spool in Simplenews 7.2

Same name and namespace in other branches
  1. 7 includes/simplenews.mail.inc \simplenews_delete_spool()

Remove records from mail spool table according to the conditions.

Return value

Count deleted

Related topics

2 calls to simplenews_delete_spool()
simplenews_node_delete in ./simplenews.module
Implements hook_node_delete().
simplenews_unsubscribe in ./simplenews.module
Unsubscribe a user from a mailing list or send a confirmation mail.

File

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

Code

function simplenews_delete_spool(array $conditions) {

  // Continue to support 'nid'.
  if (!empty($conditions['nid'])) {
    $conditions['entity_type'] = 'node';
    $conditions['entity_id'] = $conditions['nid'];
    unset($conditions['nid']);
  }
  $query = db_delete('simplenews_mail_spool');
  foreach ($conditions as $condition => $value) {
    $query
      ->condition($condition, $value);
  }
  return $query
    ->execute();
}