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:
10341034 When using OpenSSL to generate certificates, make sure to add the
10351035 ``-addtrust emailProtection `` command option.
10361036
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+
10371046Signing Messages
10381047~~~~~~~~~~~~~~~~
10391048
@@ -1515,13 +1524,6 @@ the email is sent::
15151524
15161525 Methods ``addStamp() `` and ``getStamps() `` were introduced in Symfony 6.2.
15171526
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-
15251527Execute this command to find out which listeners are registered for this event
15261528and their priorities:
15271529
You can’t perform that action at this time.
0 commit comments