Laravel 8 自定義主題

2021-07-19 10:53 更新

默認(rèn)情況下,郵件的主題就是格式為 「標(biāo)題風(fēng)格」 的通知類名,因此,如果通知類被命名為 InvoicePaid,郵件的主題就是 Invoice Paid,如果你想要為消息指定明確的主題,可以在構(gòu)建消息的時候調(diào)用 subject 方法:

/**
 * Get the mail representation of the notification.
 *
 * @param  mixed  $notifiable
 * @return \Illuminate\Notifications\Messages\MailMessage
 */
public function toMail($notifiable)
{
    return (new MailMessage)
                ->subject('Notification Subject')
                ->line('...');
} 
以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號