Skip to content

[Mailer] docs: Add the mime type in the example #17334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions mailer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,9 @@ file or stream::
$email = (new Email())
// ...
// get the image contents from a PHP resource
->embed(fopen('/path/to/images/logo.png', 'r'), 'logo')
->embed(fopen('/path/to/images/logo.png', 'r'), 'logo', 'image/png')
// get the image contents from an existing file
->embedFromPath('/path/to/images/signature.gif', 'footer-signature')
->embedFromPath('/path/to/images/signature.gif', 'footer-signature', 'image/gif')
;

The second optional argument of both methods is the image name ("Content-ID" in
Expand All @@ -401,8 +401,9 @@ images inside the HTML contents::

$email = (new Email())
// ...
->embed(fopen('/path/to/images/logo.png', 'r'), 'logo')
->embedFromPath('/path/to/images/signature.gif', 'footer-signature')
->embed(fopen('/path/to/images/logo.png', 'r'), 'logo', 'image/png')
->embedFromPath('/path/to/images/signature.gif', 'footer-signature', 'image/gif')

// reference images using the syntax 'cid:' + "image embed name"
->html('<img src="cid:logo"> ... <img src="cid:footer-signature"> ...')
;
Expand Down