Skip to content

Commit 4f3bc60

Browse files
committed
[Twig Bridge] Add PHPdoc information to some email methods
1 parent a908cd1 commit 4f3bc60

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Mime/WrappedTemplatedEmail.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ public function toName(): string
3535
return $this->message->getTo()[0]->getName();
3636
}
3737

38+
/**
39+
* @param string $image A Twig path to the image file. It's recommended to define
40+
* some Twig namespace for email images (e.g. '@email/images/logo.png').
41+
* @param string|null $contentType The media type (i.e. MIME type) of the image file (e.g. 'image/png').
42+
* Some email clients require this to display embedded images.
43+
*/
3844
public function image(string $image, string $contentType = null): string
3945
{
4046
$file = $this->twig->getLoader()->getSourceContext($image);
@@ -47,6 +53,13 @@ public function image(string $image, string $contentType = null): string
4753
return 'cid:'.$image;
4854
}
4955

56+
/**
57+
* @param string $file A Twig path to the file. It's recommended to define
58+
* some Twig namespace for email files (e.g. '@email/files/contract.pdf').
59+
* @param string|null $name A custom file name that overrides the original name of the attached file.
60+
* @param string|null $contentType The media type (i.e. MIME type) of the file (e.g. 'application/pdf').
61+
* Some email clients require this to display attached files.
62+
*/
5063
public function attach(string $file, string $name = null, string $contentType = null): void
5164
{
5265
$file = $this->twig->getLoader()->getSourceContext($file);

0 commit comments

Comments
 (0)