You are here

function simplenews_subscriber_delete in Simplenews 7

Same name and namespace in other branches
  1. 7.2 simplenews.module \simplenews_subscriber_delete()

Delete subscriber and corresponding subscriptions from the database.

Parameters

$snid: Simplenews subscriber object.

Related topics

4 calls to simplenews_subscriber_delete()
SimplenewsSourceTestCase::testSendMissingSubscriber in tests/simplenews.test
Test with disabled caching.
simplenews_rules_action_subscriber_delete in simplenews_rules/simplenews_rules.rules.inc
Action Implementation: Delete an email address from all Simplenews newsletters
simplenews_subscription_delete_multiple in includes/simplenews.admin.inc
Callback function to delete subscriptions.
simplenews_user_delete in ./simplenews.module
Implements hook_user_delete().

File

./simplenews.module, line 1701
Simplenews node handling, sent email, newsletter block and general hooks

Code

function simplenews_subscriber_delete(stdClass $subscriber) {
  simplenews_subscription_delete(array(
    'snid' => $subscriber->snid,
  ));
  db_delete('simplenews_subscriber')
    ->condition('snid', $subscriber->snid)
    ->execute();
  module_invoke_all('simplenews_subscriber_delete', $subscriber);
}