8000 Improve the warning about signing messages in a listener · symfony/symfony-docs@e45f6e9 · GitHub
[go: up one dir, main page]

Skip to content

Commit e45f6e9

Browse files
committed
Improve the warning about signing messages in a listener
1 parent 0480fdc commit e45f6e9

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

mailer.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,15 @@ Before signing/encrypting messages, make sure to have:
10441044
When using OpenSSL to generate certificates, make sure to add the
10451045
``-addtrust emailProtection`` command option.
10461046

1047+
.. caution::
8000
1048+
1049+
These features require messages to be rendered,
1050+
which is not always immediate.
1051+
For example, :ref:`templated emails <mailer-twig>` content is generated
1052+
by a :class:`Symfony\\Component\\Mailer\\EventListener\\MessageListener`.
1053+
If you need to sign and/or encrypt such a message, you need to do so in
1054+
a :ref:`MessageEvent <messageevent>` listener with a negative priority.
1055+
10471056
Signing Messages
10481057
~~~~~~~~~~~~~~~~
10491058

@@ -1432,13 +1441,6 @@ is sent::
14321441
}
14331442
}
14341443

1435-
.. tip::
1436-
1437-
When using a ``MessageEvent`` listener to
1438-
:doc:`sign the email contents <signing-and-encrypting-messages>`, run it as
1439-
late as possible (e.g. setting a negative priority for it) so the email
1440-
contents are not set or modified after signing them.
1441-
14421444
Development & Debugging
14431445
-----------------------
14441446

0 commit comments

Comments
 (0)
0