2017 © Pedro Peláez
 

typo3-flow-package swiftmailerspool

A Flow package to extend the Neos Swift Mailer by a spool for asynchronous mailing

image

we/swiftmailerspool

A Flow package to extend the Neos Swift Mailer by a spool for asynchronous mailing

  • Tuesday, March 1, 2016
  • by webessentials
  • Repository
  • 3 Watchers
  • 2 Stars
  • 1,890 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 6 % Grown

The README.md

This Flow package extends the Neos Swift Mailer by a spool for asynchronous mailing., (*1)

Configuration

The package is pre-configured to use a the file spool:, (*2)

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., (*3)

The process is the same as with the normal SwiftMailer library., (*4)

Inject the mailer interface which now is a \Swift_SpoolTransport object:, (*5)

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

Create the message:, (*6)

$mail = new \Swift_Message();

Send the message with the mailer:, (*7)

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

Now, the mail is in the spool and can really be sent by the command:, (*8)

./flow swiftmailerspool:flush

The Versions

01/03 2016

dev-master

9999999-dev

A Flow package to extend the Neos Swift Mailer by a spool for asynchronous mailing

  Sources

MIT LGPL-3.0

The Requires