8000 [Mailer] Documented the tag and metadata headers · symfony/symfony-docs@e97b186 · GitHub
[go: up one dir, main page]

Skip to content

Commit e97b186

Browse files
committed
[Mailer] Documented the tag and metadata headers
1 parent 096b320 commit e97b186

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

mailer.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,22 @@ header, etc.) but most of the times you'll set text headers::
201201
// ...
202202
;
203203

204+
When using a mailer service that supports tags and metadata, consider using the
205+
``TagHeader`` and ``MetadataHeader`` headers instead of the plain text headers::
206+
207+
use Symfony\Component\Mailer\Header\MetadataHeader;
208+
use Symfony\Component\Mailer\Header\TagHeader;
209+
210+
$email->getHeaders()->add(new TagHeader('password-reset'));
211+
$email->getHeaders()->add(new MetadataHeader('Client-ID', '12345'));
212+
213+
If your mailer doesn't support these tag/metadata headers, they are added to the
214+
message as text headers (``X-Tag: password-reset``, ``X-Metadata-Client-ID: 12345``).
215+
216+
.. versionadded:: 5.1
217+
218+
The ``TagHeader`` and ``MetadataHeader`` headers were introduced in Symfony 5.1.
219+
204220
Message Contents
205221
~~~~~~~~~~~~~~~~
3F30
206222

0 commit comments

Comments
 (0)
0