diff --git a/src/Illuminate/Mail/Mailable.php b/src/Illuminate/Mail/Mailable.php index 0e7bb7554e1f..5a412c90a900 100644 --- a/src/Illuminate/Mail/Mailable.php +++ b/src/Illuminate/Mail/Mailable.php @@ -128,8 +128,8 @@ public function send(MailerContract $mailer) $this->buildFrom($message) ->buildRecipients($message) ->buildSubject($message) - ->buildAttachments($message) - ->runCallbacks($message); + ->runCallbacks($message) + ->buildAttachments($message); }); } diff --git a/src/Illuminate/Mail/Mailer.php b/src/Illuminate/Mail/Mailer.php index 8eea89ffb3a1..b36bd9c29131 100755 --- a/src/Illuminate/Mail/Mailer.php +++ b/src/Illuminate/Mail/Mailer.php @@ -225,13 +225,13 @@ public function send($view, array $data = [], $callback = null) $data['message'] = $message = $this->createMessage(); + call_user_func($callback, $message); + // Once we have retrieved the view content for the e-mail we will set the body // of this message using the HTML type, which will provide a simple wrapper // to creating view based emails that are able to receive arrays of data. $this->addContent($message, $view, $plain, $raw, $data); - call_user_func($callback, $message); - // If a global "to" address has been set, we will set that address on the mail // message. This is primarily useful during local development in which each // message should be delivered into a single mail address for inspection.