- π¬π§United Kingdom PQ
Just a note that the current solution here seems to break when used with the sendgrid_integration module which validates the email addresses of the bcc and cc headers. If empty it throws an error.
It might be resolved by changing this:
$data['to'] = implode(',', $recipients['to']); $data['params']['headers']['Cc'] = implode(',', $recipients['cc']); $data['params']['headers']['Bcc'] = implode(',', $recipients['bcc']);
(in
src/Notification.php
line ~213) to something like:$data['to'] = implode(',', $recipients['to']); if (!empty($recipients['cc'])) { $data['params']['headers']['Cc'] = implode(',', $recipients['cc']); } if (!empty($recipients['bcc'])) { $data['params']['headers']['Bcc'] = implode(',', $recipients['bcc']); }
- π¨πSwitzerland zilloww
Zilloww β changed the visibility of the branch 3273627-toccbcc-email-config to hidden.
- π¨πSwitzerland zilloww
Zilloww β changed the visibility of the branch 3273627-toccbcc-email-config to active.
- πͺπΈSpain aleix
Just reporting that without the 'to' sendgrid transport that comes with symfony_mailer cannot work.
The to array is required for all personalization objects, and must have at least one email object with a valid email address.
`http://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html#messa...`
- πΊπΈUnited States ja09
What's the status of this? Ever since upgrading to D10, Sendgrid is throwing the error below and content can't transition. If I disable "Email Author" on the notification, the error goes away and everything works normally.
--
SendGrid\Exception\TypeException: "$emailAddress" must be a valid email address. Got: in SendGrid\Helper\Assert::email() (line 68 of /app/vendor/fastglass/sendgrid/src/Helper/Assert.php).
#0 /app/vendor/fastglass/sendgrid/src/Mail/EmailAddress.php(75): SendGrid\Helper\Assert::email('', 'emailAddress')
#1 /app/vendor/fastglass/sendgrid/src/Mail/EmailAddress.php(54): SendGrid\Mail\EmailAddress->setEmailAddress('')
#2 /app/web/modules/contrib/sendgrid_integration/src/Plugin/Mail/SendGridMail.php(272): SendGrid\Mail\EmailAddress->__construct('', NULL)
#3 /app/web/modules/contrib/mailsystem/src/Adapter.php(50): Drupal\sendgrid_integration\Plugin\Mail\SendGridMail->mail(Array)
#4 /app/web/core/lib/Drupal/Core/Mail/MailManager.php(308): Drupal\mailsystem\Adapter->mail(Array)
#5 /app/web/core/lib/Drupal/Core/Mail/MailManager.php(181): Drupal\Core\Mail\MailManager->doMail('content_moderat...', 'content_moderat...', '', 'en', Array, NULL, true)
#6 /app/web/core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\Core\Mail\MailManager->Drupal\Core\Mail\{closure}()
#7 /app/web/core/lib/Drupal/Core/Mail/MailManager.php(180): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#8 /app/web/modules/contrib/mailsystem/src/MailsystemManager.php(70): Drupal\Core\Mail\MailManager->mail('content_moderat...', 'content_moderat...', '', 'en', Array, NULL, true)
#9 /app/web/modules/contrib/content_moderation_notifications/src/Notification.php(223): Drupal\mailsystem\MailsystemManager->mail('content_moderat...', 'content_moderat...', '', 'en', Array, NULL, true)
#10 /app/web/modules/contrib/content_moderation_notifications/src/Notification.php(93): Drupal\content_moderation_notifications\Notification->sendNotification(Object(Drupal\mnpl\Entity\ShowNode), Array)
#11 /app/web/modules/contrib/content_moderation_notifications/content_moderation_notifications.module(29): Drupal\content_moderation_notifications\Notification->processEntity(Object(Drupal\mnpl\Entity\ShowNode))
#12 [internal function]: content_moderation_notifications_entity_update(Object(Drupal\mnpl\Entity\ShowNode))
#13 /app/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(416): call_user_func_array(Object(Closure), Array)
#14 /app/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(395): Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object(Closure), 'content_moderat...')
#15 /app/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(415): Drupal\Core\Extension\ModuleHandler->invokeAllWith('entity_update', Object(Closure))
#16 /app/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(217): Drupal\Core\Extension\ModuleHandler->invokeAll('entity_update', Array)
#17 /app/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(900): Drupal\Core\Entity\EntityStorageBase->invokeHook('update', Object(Drupal\mnpl\Entity\ShowNode))
#18 /app/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(564): Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('update', Object(Drupal\mnpl\Entity\ShowNode))
#19 /app/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(781): Drupal\Core\Entity\EntityStorageBase->doPostSave(Object(Drupal\mnpl\Entity\ShowNode), true)
#20 /app/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(489): Drupal\Core\Entity\ContentEntityStorageBase->doPostSave(Object(Drupal\mnpl\Entity\ShowNode), true)
#21 /app/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(806): Drupal\Core\Entity\EntityStorageBase->save(Object(Drupal\mnpl\Entity\ShowNode))
#22 /app/web/core/lib/Drupal/Core/Entity/EntityBase.php(354): Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object(Drupal\mnpl\Entity\ShowNode))
#23 /app/web/core/modules/node/src/NodeForm.php(277): Drupal\Core\Entity\EntityBase->save()
#24 [internal function]: Drupal\node\NodeForm->save(Array, Object(Drupal\Core\Form\FormState))
#25 /app/web/core/lib/Drupal/Core/Form/FormSubmitter.php(129): call_user_func_array(Array, Array)
#26 /app/web/core/lib/Drupal/Core/Form/FormSubmitter.php(67): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object(Drupal\Core\Form\FormState))
#27 /app/web/core/lib/Drupal/Core/Form/FormBuilder.php(597): Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object(Drupal\Core\Form\FormState))
#28 /app/web/core/lib/Drupal/Core/Form/FormBuilder.php(326): Drupal\Core\Form\FormBuilder->processForm('node_show_edit_...', Array, Object(Drupal\Core\Form\FormState))
#29 /app/web/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\node\NodeForm), Object(Drupal\Core\Form\FormState))
#30 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#31 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#32 /app/web/core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#33 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#34 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#35 /app/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#36 /app/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#37 /app/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#38 /app/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#39 /app/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#40 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#41 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#42 /app/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#43 /app/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#44 /app/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#45 /app/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#46 /app/web/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#47 /app/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#48 {main}