Skip to content

[Mailer] Minor tweaks in the mailer docs #12807

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
Dec 14, 2019
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
7 changes: 5 additions & 2 deletions mailer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ and create an :class:`Symfony\\Component\\Mime\\Email` object::
->text('Sending emails is fun again!')
->html('<p>See Twig integration for better HTML integration!</p>');

$mailer->send($email);
/** @var Symfony\Component\Mailer\SentMessage $sentEmail */
$sentEmail = $mailer->send($email);
// $messageId = $sentEmail->getMessageId();

// ...
}
Expand Down Expand Up @@ -157,7 +159,8 @@ both strings or address objects::

Instead of calling ``->from()`` *every* time you create a new email, you can
create an :doc:`event subscriber </event_dispatcher>` and listen to the
``MessageEvent::class`` event to set the same ``From`` email to all messages.
:class:`Symfony\\Component\\Mailer\\Event\\MessageEvent` event to set the
same ``From`` email to all messages.

Multiple addresses are defined with the ``addXXX()`` methods::

Expand Down