Commit 24db3244 authored by Simon Gadient's avatar Simon Gadient

[FEATURE] Recover spool command

Mails that got stuck in sending (e.g. SMTP timeout) will get recovered
and sent on the next flush.

refs KIME-3340
parent 9c740b7e
......@@ -47,7 +47,7 @@ class SwiftMailerSpoolCommandController extends CommandController {
protected $logger;
/**
* Flush the email spool queue
* Flush the message spool queue
*
* @throws \TYPO3\SwiftMailer\Exception
*/
......@@ -75,4 +75,18 @@ class SwiftMailerSpoolCommandController extends CommandController {
$this->logger->log($count . ' recipients failed. Check the spool if messages got stuck.', LOG_WARNING, 'SwiftMailerSpool');
}
}
/**
* Recover messages that got stuck in the spool.
*
* @throws \TYPO3\SwiftMailer\Exception
*/
public function recoverCommand() {
/** @var \Swift_ConfigurableSpool $spool */
$spool = $this->spoolMailer->getTransport()->getSpool();
if ($spool instanceof \Swift_FileSpool) {
$spool->recover();
$this->logger->log('Mails recovered.', LOG_DEBUG, 'SwiftMailerSpool');
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment