Skip to content
Snippets Groups Projects

Issue #3207771 When a user account doesn't have an email, new user notification email attempt shouldn't be made

Open Issue #3207771 When a user account doesn't have an email, new user notification email attempt shouldn't be made
@@ -136,7 +136,10 @@ public function postSave(EntityStorageInterface $storage, $update = TRUE) {
if ($this->status->value != $this->original->status->value) {
// The user's status is changing; conditionally send notification email.
$op = $this->status->value == 1 ? 'status_activated' : 'status_blocked';
_user_mail_notify($op, $this);
// Send email only if user account has an email.
if ($this->getEmail()) {
_user_mail_notify($op, $this);
}
}
}
}
Loading