Skip to content

warning about using swiftmail with file spool and lazy loading #7104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions email/spool.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,16 @@ You can also set the time limit in seconds:
Of course you will not want to run this manually in reality. Instead, the
console command should be triggered by a cron job or scheduled task and run
at a regular interval.

.. caution::

When you use the filesystem for spooling, messages are serialized with
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The explanation is very clear to me ... but maybe we'd need at the beginning a short phrase explaining the Swift_Message_<someRandomCharacters> thing that you mention later. Otherwise, this may be confusing:

messages are serialized with the message class name.

Which class name? I don't create classes to send messages! You don't create them ... but SwiftMailer does that for you.

the message class name. If the service is lazy loaded this class name
change on every cache clear. So if you send a mail, then you clear the
cache, the message will not be unserialisable.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unserialisable -> unserializable (because we use American English instead of British English)


On the next ``swiftmailer:spool:send`` an error will raise because the
class ``Swift_Message_<someRandomCharacters>`` doesn't exist (anymore).

The solutions are either to use the memory spool or to load the
swiftmailer without ``lazy`` option.
Copy link
Member

@javiereguiluz javiereguiluz Oct 31, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something looks missing here:

... to load the swiftmailer without ...

"the swiftmailer" ... library? service?

And another question: about the lazy option. It's not explained in http://symfony.com/doc/current/reference/configuration/swiftmailer.html, so this may confuse some readers.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still a valid comment, I'm trying to figure out here which service I should change to adjust the lazy option.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(as using the container debugger, there seems not to be a swiftmailer service registered)