Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ef3ab27

Browse files
nykopolxabbuh
authored andcommitted
more precision on class name, and lazy service
1 parent f97db93 commit ef3ab27

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

email/spool.rst

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,18 @@ at a regular interval.
144144

145145
.. caution::
146146

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.
147+
When you create a message with swiftmailer, it generate a Swift_Message
148+
class. If the swiftmailer service is lazy loaded, it generate instead a
149+
proxy class named Swift_Message_<someRandomCharacters>.
150+
151+
If you use the memory spool, this change is transparent and has no impart.
152+
But when you use the filesystem spool, the message class is serialized on
153+
a file with the randomized class name. The problem is that this random
154+
class name change on every cache clear. So if you send a mail, then you
155+
clear the cache, the message will not be unserializable.
151156

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

155-
The solutions are either to use the memory spool or to load the
156-
swiftmailer without ``lazy`` option.
160+
The solutions are either to use the memory spool or to load the
161+
swiftmailer service without ``lazy`` option (see :doc:`/service_container/lazy_services`).

0 commit comments

Comments
 (0)