Skip to content

Commit 00250e0

Browse files
committed
[Mime] Allow to embed images as CSS backgrounds
1 parent 8c4de2c commit 00250e0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

mailer.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,10 +467,18 @@ images inside the HTML contents::
467467
// ...
468468
->embed(fopen('/path/to/images/logo.png', 'r'), 'logo')
469469
->embedFromPath('/path/to/images/signature.gif', 'footer-signature')
470+
470471
// reference images using the syntax 'cid:' + "image embed name"
471472
->html('<img src="cid:logo"> ... <img src="cid:footer-signature"> ...')
473+
474+
// use the same syntax for images included as CSS background images
475+
->html('... <div style="background-image: url(cid:footer-signature)"> ... </div> ...')
472476
;
473477

478+
.. versionadded:: 6.1
479+
480+
The option to include images as CSS backgrounds was introduced in Symfony 6.1.
481+
474482
.. _mailer-configure-email-globally:
475483

476484
Configuring Emails Globally

0 commit comments

Comments
 (0)