diff --git a/app/Notifications/ConfirmEmail.php b/app/Notifications/ConfirmEmail.php index f3797e6e2..7ecadc298 100644 --- a/app/Notifications/ConfirmEmail.php +++ b/app/Notifications/ConfirmEmail.php @@ -1,17 +1,7 @@ -token = $token; } - /** - * Get the notification's delivery channels. - * - * @param mixed $notifiable - * @return array - */ - public function via($notifiable) - { - return ['mail']; - } - /** * Get the mail representation of the notification. * @@ -43,10 +22,10 @@ class ConfirmEmail extends Notification implements ShouldQueue public function toMail($notifiable) { $appName = ['appName' => setting('app-name')]; - return (new MailMessage) - ->subject(trans('auth.email_confirm_subject', $appName)) - ->greeting(trans('auth.email_confirm_greeting', $appName)) - ->line(trans('auth.email_confirm_text')) - ->action(trans('auth.email_confirm_action'), baseUrl('/register/confirm/' . $this->token)); + return $this->newMailMessage() + ->subject(trans('auth.email_confirm_subject', $appName)) + ->greeting(trans('auth.email_confirm_greeting', $appName)) + ->line(trans('auth.email_confirm_text')) + ->action(trans('auth.email_confirm_action'), baseUrl('/register/confirm/' . $this->token)); } } diff --git a/app/Notifications/MailNotification.php b/app/Notifications/MailNotification.php new file mode 100644 index 000000000..413ac6d73 --- /dev/null +++ b/app/Notifications/MailNotification.php @@ -0,0 +1,35 @@ +view([ + 'html' => 'vendor.notifications.email', + 'text' => 'vendor.notifications.email-plain' + ]); + } + +} \ No newline at end of file diff --git a/app/Notifications/ResetPassword.php b/app/Notifications/ResetPassword.php index 86e93228f..282aa335a 100644 --- a/app/Notifications/ResetPassword.php +++ b/app/Notifications/ResetPassword.php @@ -1,11 +1,7 @@ -token = $token; } - /** - * Get the notification's channels. - * - * @param mixed $notifiable - * @return array|string - */ - public function via($notifiable) - { - return ['mail']; - } - /** * Build the mail representation of the notification. * @@ -42,7 +27,7 @@ class ResetPassword extends Notification */ public function toMail() { - return (new MailMessage) + return $this->newMailMessage() ->subject(trans('auth.email_reset_subject', ['appName' => setting('app-name')])) ->line(trans('auth.email_reset_text')) ->action(trans('auth.reset_password'), baseUrl('password/reset/' . $this->token)) diff --git a/config/mail.php b/config/mail.php index 689be99b8..a5aff0239 100644 --- a/config/mail.php +++ b/config/mail.php @@ -110,15 +110,19 @@ return [ /* |-------------------------------------------------------------------------- - | Mail "Pretend" + | Markdown Mail Settings |-------------------------------------------------------------------------- | - | When this option is enabled, e-mail will not actually be sent over the - | web and will instead be written to your application's logs files so - | you may inspect the message. This is great for local development. + | If you are using Markdown based email rendering, you may configure your + | theme and component paths here, allowing you to customize the design + | of the emails. Or, you may simply stick with the Laravel defaults! | */ - - 'pretend' => env('MAIL_PRETEND', false), + 'markdown' => [ + 'theme' => 'default', + 'paths' => [ + resource_path('views/vendor/mail'), + ], + ], ]; diff --git a/resources/views/vendor/notifications/email-plain.blade.php b/resources/views/vendor/notifications/email-plain.blade.php index 7ca1dc8d0..d8e2a0acd 100644 --- a/resources/views/vendor/notifications/email-plain.blade.php +++ b/resources/views/vendor/notifications/email-plain.blade.php @@ -2,8 +2,6 @@ if (! empty($greeting)) { echo $greeting, "\n\n"; -} else { - echo $level == 'error' ? 'Whoops!' : 'Hello!', "\n\n"; } if (! empty($introLines)) {