Skip to content

Commit 213a370

Browse files
MaxTinglecaimaxtingletaylorotwell
authored
[11.x] Allow view content dependent mail callbacks (#51990)
* Allow view content dependent mail callbacks * Update Mailer.php --------- Co-authored-by: Max Tingle <[email protected]> Co-authored-by: Taylor Otwell <[email protected]>
1 parent 217789d commit 213a370

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/Illuminate/Mail/Mailer.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -303,22 +303,19 @@ public function send($view, array $data = [], $callback = null)
303303

304304
$data['mailer'] = $this->name;
305305

306-
// First we need to parse the view, which could either be a string or an array
307-
// containing both an HTML and plain text versions of the view which should
308-
// be used when sending an e-mail. We will extract both of them out here.
306+
// Once we have retrieved the view content for the e-mail we will set the body
307+
// of this message using the HTML type, which will provide a simple wrapper
308+
// to creating view based emails that are able to receive arrays of data.
309309
[$view, $plain, $raw] = $this->parseView($view);
310310

311311
$data['message'] = $message = $this->createMessage();
312312

313-
// Once we have retrieved the view content for the e-mail we will set the body
314-
// of this message using the HTML type, which will provide a simple wrapper
315-
// to creating view based emails that are able to receive arrays of data.
313+
$this->addContent($message, $view, $plain, $raw, $data);
314+
316315
if (! is_null($callback)) {
317316
$callback($message);
318317
}
319318

320-
$this->addContent($message, $view, $plain, $raw, $data);
321-
322319
// If a global "to" address has been set, we will set that address on the mail
323320
// message. This is primarily useful during local development in which each
324321
// message should be delivered into a single mail address for inspection.

0 commit comments

Comments
 (0)