[英]How I can send an email to 2 or more email on send mail layout laravel 5.3?
[英]How can I custom sender and header on send mail layout laravel 5.3?
我的代碼是這樣的:
public function toMail($notifiable)
{
return (new MailMessage)
->subject('You have new follower')
->greeting('Hello!')
->line('Welcome to my application')
->line('Thank you');
}
看到我標記為藍色。 我要自定義。
我在https://laravel.com/docs/5.3/notifications#mail-notifications上閱讀,但沒有找到
如何自定義?
您可能需要更改配置。
config/app.php
將name
值更改為任意值,在config/mail.php
您可以編輯from
值。
如果希望from與默認from不同,可以在MailMessage
鏈中調用from
方法。
public function toMail($notifiable)
{
return (new MailMessage)
->subject('You have new follower')
->from('cthulhu@microsoft.com', 'Moses Toh')
->greeting('Hello!')
->line('Welcome to my application')
->line('Thank you');
}
此外,如果您想實際修改電子郵件的layout / html / css,請在此處https://laravel.com/docs/5.3/notifications#mail-notifications中查看“ 自定義模板 ”部分
您可以通過發布通知包的資源來修改郵件通知所使用的HTML和純文本模板。 運行此命令后,郵件通知模板將位於
resources/views/vendor/notifications
目錄中:
php artisan vendor:publish --tag=laravel-notifications
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.