Skip to content

A Flow package to extend the Neos SwiftMailer by a spool for asynchronous mailing.

Notifications You must be signed in to change notification settings

webessentials/WE.SwiftMailerSpool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This Flow package extends the Neos Swift Mailer by a spool for asynchronous mailing.

Configuration

The package is pre-configured to use a the file spool:

WE:
  SwiftMailerSpool:
	spool:
	  type: 'Swift_FileSpool'
	  options: []
	  arguments:
		path: %FLOW_PATH_DATA%/SwiftMailerSpool/

Usage

Different from the Neos Swift Mailer, a \Swift_Message has to be created instead of using the \TYPO3\SwiftMailer\Message object. This is due to a problem on the serialization of the message that happens in the \FileSpool as the serialized \TYPO3\SwiftMailer\Message does not include its private parent properties of the \Swift_Message.

The process is the same as with the normal SwiftMailer library.

Inject the mailer interface which now is a \Swift_SpoolTransport object:

/**
 * @Flow\Inject
 * @var \TYPO3\SwiftMailer\MailerInterface
 */
protected $mailer;

Create the message:

$mail = new \Swift_Message();

Send the message with the mailer:

$this->mailer->send($mail);

Now, the mail is in the spool and can really be sent by the command:

./flow swiftmailerspool:flush

About

A Flow package to extend the Neos SwiftMailer by a spool for asynchronous mailing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages