Problem/Motivation
Cron is spitting out a lot of errors like:
Exception: Error sending e-mail (from <em class="placeholder">example@test.com</em> to <em class="placeholder"></em>). in Drupal\queue_mail\Plugin\QueueWorker\SendMailQueueWorker->processItem() (line 87 of /data/app/modules/contrib/queue_mail/src/Plugin/QueueWorker/SendMailQueueWorker.php)
Error sending email (from example@test.com to with reply-to not set).
Tracing this back to the source, it's due to workbench_email adding NULL recipients for accounts without an email address. I'm using SwiftMailer so it's success return value is based on the number of emails sent (which will be 0 for a null TO). This is used by SendMailQueueWorker to evaluate if the mail was successful, if not it'll log an error and throw an exception.
Proposed resolution
Add an array_filter to the prepareRecipients function in WorkbenchTransitionEventSubscriber
Remaining tasks
Tests, code.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 2927034-4.patch | 1.59 KB | acbramley |
| #3 | 2927034-failing-test-3.patch | 1.03 KB | acbramley |
Comments
Comment #2
acbramley commentedComment #3
acbramley commentedHere's a failing test.
Comment #4
acbramley commentedComment #5
acbramley commentedAnd the fix.
Comment #8
acbramley commented2nd failure is not related to my changes by the looks of it:
Comment #9
acbramley commentedD.O went down and caused a triple post.
Comment #10
acbramley commentedD.O went down and caused a triple post.
Comment #11
larowlanNot sure how someone would get an account without an email, but this looks good to me.
Comment #12
larowlanQueued on 8.4 where there are no deprecations
Comment #13
acbramley commented@larowlan the email field isn't required any more on the user creation form :) (I was surprised too) http://cgit.drupalcode.org/drupal/tree/core/modules/user/src/AccountForm...
Comment #14
larowlanComment #16
larowlanrolling 8.x-1.0-alpha7