Skip to content

Commit c0d84b9

Browse files
committed
add warning about the limitation on using swiftmail with file spool and lazy loading
1 parent 6a90c82 commit c0d84b9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

email/spool.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,16 @@ You can also set the time limit in seconds:
141141
Of course you will not want to run this manually in reality. Instead, the
142142
console command should be triggered by a cron job or scheduled task and run
143143
at a regular interval.
144+
145+
.. caution::
146+
147+
When you use the filesystem for spooling, messages are serialized with
148+
the message class name. If the service is lazy loaded this class name
149+
change on every cache clear. So if you send a mail, then you clear the
150+
cache, the message will not be unserialisable.
151+
152+
On the next ``swiftmailer:spool:send`` an error will raise because the
153+
class ``Swift_Message_<someRandomCharacters>`` doesn't exist (anymore).
154+
155+
The solutions are either to use the memory spool or to load the
156+
swiftmailer without ``lazy`` option.

0 commit comments

Comments
 (0)