function simplenews_delete_subscription in Simplenews 5
Same name and namespace in other branches
- 6.2 simplenews.module \simplenews_delete_subscription()
- 6 simplenews.module \simplenews_delete_subscription()
API function; deletes every subscription for the given subscription ID.
2 calls to simplenews_delete_subscription()
- simplenews_admin_users_delete_submit in ./
simplenews.module - Forms API callback; delete user subscription submit.
- simplenews_subscription_multiple_delete_confirm_submit in ./
simplenews.module
File
- ./
simplenews.module, line 2488
Code
function simplenews_delete_subscription($snid) {
$account = db_fetch_object(db_query('SELECT mail FROM {simplenews_subscriptions} WHERE snid = %d', $snid));
db_query('DELETE FROM {simplenews_subscriptions} WHERE snid = %d', $snid);
db_query('DELETE FROM {simplenews_snid_tid} WHERE snid = %d', $snid);
watchdog('newsletter', t('User %email deleted from the subscription list.', array(
'%email' => $account->mail,
)));
}