You are here

function simplenews_user_delete in Simplenews 3.x

Same name and namespace in other branches
  1. 8.2 simplenews.module \simplenews_user_delete()
  2. 8 simplenews.module \simplenews_user_delete()
  3. 7.2 simplenews.module \simplenews_user_delete()
  4. 7 simplenews.module \simplenews_user_delete()

Implements hook_ENTITY_TYPE_delete() for user entity.

File

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

Code

function simplenews_user_delete(UserInterface $account) {

  // Delete subscription when account is removed.
  if ($subscriber = Subscriber::loadByUid($account
    ->id())) {
    $subscriber
      ->delete();
  }
}