Skip to content
Snippets Groups Projects

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

Open Issue #3312582: When a user account doesn't have an email, new user notification email attempt shouldn't be made
1 file
+ 4
1
Compare changes
  • Side-by-side
  • Inline
@@ -136,7 +136,10 @@ public function postSave(EntityStorageInterface $storage, $update = TRUE) {
@@ -136,7 +136,10 @@ public function postSave(EntityStorageInterface $storage, $update = TRUE) {
if ($this->status->value != $this->original->status->value) {
if ($this->status->value != $this->original->status->value) {
// The user's status is changing; conditionally send notification email.
// The user's status is changing; conditionally send notification email.
$op = $this->status->value == 1 ? 'status_activated' : 'status_blocked';
$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