Skip to content

Commit 7a0bdba

Browse files
committed
minor #12807 [Mailer] Minor tweaks in the mailer docs (javiereguiluz)
This PR was merged into the 4.3 branch. Discussion ---------- [Mailer] Minor tweaks in the mailer docs Maybe you don't like this proposal (it's fine to close without merging) but I'd prefer to make it very obvious that `send()` returns a special class which provides useful methods. Commits ------- 403cc50 [Mailer] Minor tweaks in the mailer docs
2 parents 5250be1 + 403cc50 commit 7a0bdba

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

mailer.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ and create an :class:`Symfony\\Component\\Mime\\Email` object::
121121
->text('Sending emails is fun again!')
122122
->html('<p>See Twig integration for better HTML integration!</p>');
123123

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

126128
// ...
127129
}
@@ -157,7 +159,8 @@ both strings or address objects::
157159

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

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

0 commit comments

Comments
 (0)