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 @@ -1034,6 +1034,15 @@ Before signing/encrypting messages, make sure to have:
1034
1034
When using OpenSSL to generate certificates, make sure to add the
1035
1035
``-addtrust emailProtection `` command option.
1036
1036
1037
+ .. caution ::
1038
+
1039
+ Signing and encrypting messages require their contents to be fully rendered.
1040
+ For example, the content of :ref: `templated emails <mailer-twig >` is rendered
1041
+ by a :class: `Symfony\\ Component\\ Mailer\\ EventListener\\ MessageListener `.
1042
+ So, if you want to sign and/or encrypt such a message, you need to do it in
1043
+ a :ref: `MessageEvent <messageevent >` listener run after it (you need to set
1044
+ a negative priority to your listener).
1045
+
1037
1046
Signing Messages
1038
1047
~~~~~~~~~~~~~~~~
1039
1048
@@ -1515,13 +1524,6 @@ the email is sent::
1515
1524
1516
1525
Methods ``addStamp() `` and ``getStamps() `` were introduced in Symfony 6.2.
1517
1526
1518
- .. tip ::
1519
-
1520
- When using a ``MessageEvent `` listener to
1521
- :doc: `sign the email contents <signing-and-encrypting-messages >`, run it as
1522
- late as possible (e.g. setting a negative priority for it) so the email
1523
- contents are not set or modified after signing them.
1524
-
1525
1527
Execute this command to find out which listeners are registered for this event
1526
1528
and their priorities:
1527
1529
You can’t perform that action at this time.
0 commit comments