doMail(): Argument #1 ($to) must be of type string, null given

Created on 13 March 2025, 27 days ago

Problem/Motivation

Getting this error in the logs when user email is not defined:

#0 /var/www/html/web/core/lib/Drupal/Core/Mail/Plugin/Mail/PhpMail.php(123): Drupal\Core\Mail\Plugin\Mail\PhpMail->doMail(NULL, 'Your account wi...', 'Dear User,\n\nYou...', 'MIME-Version: 1...', '-<edited>...')
#1 /var/www/html/web/core/lib/Drupal/Core/Mail/MailManager.php(308): Drupal\Core\Mail\Plugin\Mail\PhpMail->mail(Array)
#2 /var/www/html/web/core/lib/Drupal/Core/Mail/MailManager.php(181): Drupal\Core\Mail\MailManager->doMail('purge_users', 'cancel_users', NULL, 'en', Array, NULL, true)
#3 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(593): Drupal\Core\Mail\MailManager->Drupal\Core\Mail\{closure}()
#4 /var/www/html/web/core/lib/Drupal/Core/Mail/MailManager.php(180): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))

Investigating.

🐛 Bug report
Status

Active

Version

4.0

Component

Code

Created by

🇫🇷France mably

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024