Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
nykopol wants to merge3 commits intosymfony:masterfromnykopol:fix_5596
Closed
Changes fromall commits
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
18 changes: 18 additions & 0 deletionsemail/spool.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -141,3 +141,21 @@ 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 create a message with SwiftMailer, it generates a ``Swift_Message``
class. If the ``swiftmailer`` service is lazy loaded, it generates instead a
proxy class named ``Swift_Message_<someRandomCharacters>``.

If you use the memory spool, this change is transparent and has no impact.
But when using the filesystem spool, the message class is serialized in
a file with the randomized class name. The problem is that this random
class name changes on every cache clear. So if you send a mail and then you
clear the cache, the message will not be unserializable.

On the next execution of ``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`` service without ``lazy`` option (see :doc:`/service_container/lazy_services`).

[8]ページ先頭

©2009-2025 Movatter.jp