- Issue created by @kallado
- 🇵🇹Portugal kallado
To add the variables to the SymfonyMailerQueueItem I think it shoul be somewere in QueueSendingEmailAdjuster
probably here:if (!$email->isInQueue()) { $queue = $this->queueFactory->get(SymfonyMailerQueueWorker::QUEUE_NAME, TRUE); $item = new SymfonyMailerQueueItem( $email->getType(), $email->getSubType(), $email->getParams(), $this->configuration, ); $queue->createItem($item);
Where we could use the Email method getVariables() to retrieve the values
- Status changed to Needs work
3 months ago 2:15pm 4 September 2024 - 🇩🇪Germany simonbaese Berlin
Thanks for the report. I am traveling right now. Will be able to get to the issue next week.
- 🇵🇹Portugal kallado
@simonbaese Thanks I'm available to help if you need to just a lot of work at the moment to dive into this.
- Assigned to simonbaese
- 🇩🇪Germany simonbaese Berlin
I checked the issue today. Building emails programmatically does not work correctly, as reported. Unfortunately, this applies not only to variables but also to other email properties. The issue stems from the Drupal Symfony Mailer overloading the responsibilities of the email object. Hence, the email object can not be serialized easily to pass data to the queue worker.
Probably, the only way forward is to carry all the build properties to the queue worker and reinstate them again. This approach is slightly ugly and I will sleep on it.
A workaround for now is to use an email builder plugin and delegate the assignment of variables to it.
Bumping to major priority because this bug affects all emails built in the described way.