Sorry, the issue has been opened in the wrong project. it was solved in the dev branch of the AI module.
samaphp β created an issue.
It seems a real major issue for those who sending email messages using queue_mail.
It seems a well-known issue as per this link:
https://www.drupal.org/project/drupal/issues/3085157 β
We've tried the renderRoot() but there is no luck, still fails.
We are using queue_mail module with this HTMLMail, so we had to come up with a workaround to execute the queue temporarily in a cronjob calling the browser URL from a controller to overcome this issue.
$queueFactory = \Drupal::service('queue');
$queueManager = \Drupal::service('plugin.manager.queue_worker');
/** @var \Drupal\queue_mail\Plugin\QueueWorker\SendMailQueueWorker $queueWorker */
$queueWorker = $queueManager->createInstance('queue_mail');
/** @var \Drupal\Core\Queue\DatabaseQueue $queue */
$queue = $queueFactory->get('queue_mail');
if ($queue->numberOfItems() > 0) {
// Get the number of items to process
for ($i = 0; $i < $queue->numberOfItems(); $i++) {
// Process the queue
if ($item = $queue->claimItem()) {
$workerResponse = $queueWorker->processItem($item->data);
if (!empty($workerResponse) && !empty($workerResponse['result']) && ($workerResponse['result'] === TRUE)) {
$queue->deleteItem($item);
}
else {
// We will release it immediately.
$queue->releaseItem($item);
}
}
}
}
CAUTION: This should be used only in cases where there are not too many emails, this is not a scalable solution and should be used only for small/experimental sites.
samaphp β changed the visibility of the branch 3185539-add-a-delete to active.
samaphp β changed the visibility of the branch 3185539-add-a-delete to hidden.
samaphp β created an issue.
Patch #21 Tested on Drupal 9.5.9
It's simply working well.
I liked that it is just a simple line of code.
Hope it gets approved soon. thanks.
samaphp β created an issue.
samaphp β created an issue.
The attached patch should add a default value for $block_id
to insure the variable will always be an array.
samaphp β created an issue.
Thank you guys, we hope to see this merged soon. thanks