@@ -733,26 +733,17 @@ adding a text header ``X-Transport`` to an email::
733
733
Adding Tags and Metadata to Emails
734
734
----------------------------------
735
735
736
- Certain 3rd party transports support email *tags * and *metadata *. These can be
737
- used by the 3rd party service for grouping, tracking and workflows. The
738
- :class: `Symfony\\ Component\\ Mailer\\ Header\\ TagHeader ` and
739
- :class: `Symfony\\ Component\\ Mailer\\ Header\\ MetadataHeader ` headers can be
740
- added to your email. If your transport supports these headers, they will be
741
- applied in the format specific to the transport.
742
-
743
736
.. versionadded :: 5.1
744
737
745
738
The :class: `Symfony\\ Component\\ Mailer\\ Header\\ TagHeader ` and
746
739
:class: `Symfony\\ Component\\ Mailer\\ Header\\ MetadataHeader ` classes were
747
740
introduced in Symfony 5.1.
748
741
749
- The following 3rd party transports currently support tags and metadata:
750
-
751
- * Postmark
752
- * Mailgun
753
- * MailChimp
754
-
755
- For example, say you want to tag an email and add some metadata::
742
+ Certain 3rd party transports support email *tags * and *metadata *, which can be used
743
+ for grouping, tracking and workflows. You can add those by using the
744
+ :class: `Symfony\\ Component\\ Mailer\\ Header\\ TagHeader ` and
745
+ :class: `Symfony\\ Component\\ Mailer\\ Header\\ MetadataHeader ` classes. If your transport
746
+ supports headers, it will convert them to their appropriate format::
756
747
757
748
use Symfony\Component\Mailer\Header\MetadataHeader;
758
749
use Symfony\Component\Mailer\Header\TagHeader;
@@ -761,16 +752,20 @@ For example, say you want to tag an email and add some metadata::
761
752
$email->getHeaders()->add(new MetadataHeader('Color', 'blue'));
762
753
$email->getHeaders()->add(new MetadataHeader('Client-ID', '12345'));
763
754
764
- When sending this email with a transport that supports tags and metadata, the transport
765
- will convert these to their appropriate format. If using a transport that does not
766
- support tags and metadata, they will be added as custom headers:
755
+ If your transport does not support tags and metadata, they will be added as custom headers:
767
756
768
757
.. code-block :: text
769
758
770
759
X-Tag: password-reset
771
760
X-Metadata-Color: blue
772
761
X-Metadata-Client-ID: 12345
773
762
763
+ The following transports currently support tags and metadata:
764
+
765
+ * Postmark
766
+ * Mailgun
767
+ * MailChimp
768
+
774
769
Development & Debugging
775
770
-----------------------
776
771
0 commit comments