File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -626,11 +626,27 @@ images inside the HTML contents::
626
626
->html('... <div background="cid:footer-signature"> ... </div> ...')
627
627
;
628
628
629
+ You can also use the :method: `DataPart::setContentId() <Symfony\\ Component\\ Mime\\ Part\\ DataPart::setContentId> `
630
+ method to define a custom Content-ID for the image and use it as its ``cid `` reference::
631
+
632
+ $part = new DataPart(new File('/path/to/images/signature.gif'));
633
+ $part->setContentId('footer-signature');
634
+
635
+ $email = (new Email())
636
+ // ...
637
+ ->addPart($part->asInline())
638
+ ->html('... <img src="cid:footer-signature"> ...')
639
+ ;
640
+
629
641
.. versionadded :: 6.1
630
642
631
643
The support of embedded images as HTML backgrounds was introduced in Symfony
632
644
6.1.
633
645
646
+ .. versionadded :: 6.3
647
+
648
+ The support of custom ``cid `` for embedded images was introduced in Symfony 6.3.
649
+
634
650
.. _mailer-configure-email-globally :
635
651
636
652
Configuring Emails Globally
You can’t perform that action at this time.
0 commit comments