有人知道如何在通过Laravel 通知系统发送的电子邮件中添加标题吗?
我不是在谈论可以通过该方法设置标头的Mailable类withSwiftMessage()
!
MailMessage
一旦我有很多使用line
,方法构建的电子邮件,我也想继续使用greetings
!
任何人有任何线索?
有我的代码以防有人需要查看任何东西!
<?php
namespace PumpMyLead\Notifications\Tenants\Auth;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
class AccountActivation extends Notification
{
use Queueable;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage)
->subject('My email subject')
->greeting('Just a greeting')
->line('Line 1')
->line('Line 2')
->action('CTA wanted', 'http://www.pumpmylead.com')
->line('Byebye');
}
}
提前致谢!