Problem/Motivation
A user can be created anonymous or without an email address. However, postSave() hook tries to send an email after an user is created and it results in an error if the email handlers aren't checking for empty email addresses before hand.
Proposed resolution
User entity postSave() hook should check for the email address prior to making an email sending attempt.
Issue fork drupal-3312582
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3312582-no-user-mail-notification
changes, plain diff MR !3706
- 3312582-when-a-user
changes, plain diff MR !2818
Comments
Comment #3
fathima.asmat commentedComment #4
cilefen commentedComment #8
mehul.gadaSince MR should not be raised for the 9.4.x branch, I have rerolled the patch for 9.5.x and accordingly raised MR https://git.drupalcode.org/project/drupal/-/merge_requests/3706
Comment #9
smustgrave commentedNeeds a test case showing the issue.
Comment #11
dcam commentedThis was handled in
_user_mail_notify()by #3518058: _user_mail_notify() doesn't handle accounts without an email address.