File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
src/Symfony/Component/Mime Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -480,6 +480,12 @@ private function prepareParts(): ?array
480
480
foreach ($ this ->attachments as $ attachment ) {
481
481
foreach ($ names as $ name ) {
482
482
if (isset ($ attachment ['part ' ])) {
483
+ if ($ attachment ['part ' ]->getPreparedHeaders ()->getHeaderBody ('Content-Disposition ' ) === 'inline ' ) {
484
+ $ inlineParts [] = $ attachment ['part ' ];
485
+
486
+ continue 2 ;
487
+ }
488
+
483
489
continue ;
484
490
}
485
491
if ($ name !== $ attachment ['name ' ]) {
Original file line number Diff line number Diff line change @@ -344,6 +344,12 @@ public function testGenerateBody()
344
344
// 2 parts only, not 3 (text + embedded image once)
345
345
$ this ->assertCount (2 , $ parts = $ body ->getParts ());
346
346
$ this ->assertStringMatchesFormat ('html content <img src=3D"cid:%s@symfony"> ' , $ parts [0 ]->bodyToString ());
347
+
348
+ $ e = (new Email ())->from ('me@example.com ' )->to ('you@example.com ' );
349
+ $ e ->html ('html content <img src="cid:test.gif"> ' );
350
+ $ e ->attachPart ((new DataPart ($ image , 'test.gif ' ))->asInline ());
351
+ $ body = $ e ->getBody ();
352
+ $ this ->assertInstanceOf (RelatedPart::class, $ body );
347
353
}
348
354
349
355
public function testAttachments ()
You can’t perform that action at this time.
0 commit comments