function simplenews_user_insert in Simplenews 3.x
Same name and namespace in other branches
- 8.2 simplenews.module \simplenews_user_insert()
- 8 simplenews.module \simplenews_user_insert()
- 7.2 simplenews.module \simplenews_user_insert()
- 7 simplenews.module \simplenews_user_insert()
Implements hook_ENTITY_TYPE_insert() for user entity.
If there is a matching subscription, link it to this account.
File
- ./
simplenews.module, line 435 - Simplenews node handling, sent email, newsletter block and general hooks.
Code
function simplenews_user_insert(UserInterface $account) {
if ($subscriber = Subscriber::loadByMail($account
->getEmail())) {
$subscriber
->fillFromAccount($account)
->save();
}
}