File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -1074,6 +1074,15 @@ Before signing/encrypting messages, make sure to have:
10741074 When using OpenSSL to generate certificates, make sure to add the
10751075 ``-addtrust emailProtection `` command option.
10761076
1077+ .. caution ::
1078+
1079+ Signing and encrypting messages require their contents to be fully rendered.
1080+ For example, the content of :ref: `templated emails <mailer-twig >` is rendered
1081+ by a :class: `Symfony\\ Component\\ Mailer\\ EventListener\\ MessageListener `.
1082+ So, if you want to sign and/or encrypt such a message, you need to do it in
1083+ a :ref: `MessageEvent <messageevent >` listener run after it (you need to set
1084+ a negative priority to your listener).
1085+
10771086Signing Messages
10781087~~~~~~~~~~~~~~~~
10791088
@@ -1569,13 +1578,6 @@ also stop the event propagation)::
15691578
15701579 The ``reject() `` method was introduced in Symfony 6.3.
15711580
1572- .. tip ::
1573-
1574- When using a ``MessageEvent `` listener to
1575- :doc: `sign the email contents <signing-and-encrypting-messages >`, run it as
1576- late as possible (e.g. setting a negative priority for it) so the email
1577- contents are not set or modified after signing them.
1578-
15791581Execute this command to find out which listeners are registered for this event
15801582and their priorities:
15811583
You can’t perform that action at this time.
0 commit comments