我正在尝试自定义通过电子邮件发送通知时使用的HTML电子邮件布局.
我已经发布了邮件和通知视图.
php artisan vendor:publish --tag=laravel-mail
php artisan vendor:publish --tag=laravel-notifications
如果我修改/resources/views/vendor/notifications/email.blade.php
文件,我只能更改发送的电子邮件的BODY内容.我也希望修改页脚,标题和电子邮件布局的其他所有部分.
我也尝试修改内部视图/resources/vendor/mail/html/
,但每当发送通知时,它甚至不使用这些视图,而是使用默认的laravel框架.
我知道我可以设置在一个视图MailMessage
通过我的通知类返回,但我想保持标准line()
,greeting()
等等功能.
有谁知道我如何通过视图发送电子邮件的通知/resources/vendor/mail/html
?
以下是我的/resources/views/vendor/notifications/email.blade.php
文件,但它没有任何地方可以自定义页眉/页脚/整体布局.
@component('mail::message')
{{-- Greeting --}}
@if (! empty($greeting))
# {{ $greeting }}
@else
@if ($level == 'error')
# Whoops!
@else
# Hello!
@endif
@endif
{{-- Intro Lines --}}
@foreach ($introLines as $line)
{{ $line }}
@endforeach
{{-- Action Button --}}
@if (isset($actionText))
<?php
switch ($level) {
case 'success':
$color = 'green';
break; …
Run Code Online (Sandbox Code Playgroud)