File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff 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+
204220Message Contents
205221~~~~~~~~~~~~~~~~
206222
You can’t perform that action at this time.
0 commit comments