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:
1074
1074
When using OpenSSL to generate certificates, make sure to add the
1075
1075
``-addtrust emailProtection `` command option.
1076
1076
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
+
1077
1086
Signing Messages
1078
1087
~~~~~~~~~~~~~~~~
1079
1088
@@ -1569,13 +1578,6 @@ also stop the event propagation)::
1569
1578
1570
1579
The ``reject() `` method was introduced in Symfony 6.3.
1571
1580
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
-
1579
1581
Execute this command to find out which listeners are registered for this event
1580
1582
and their priorities:
1581
1583
You can’t perform that action at this time.
0 commit comments