我的通知电子邮件中总是出现错误。知道如何在 Laravel 电子邮件通知中支持密件抄送吗?我使用 Laravel 5.4。
错误:
Call to a member function bcc() on null
Run Code Online (Sandbox Code Playgroud)
代码:
$inquiry->notify(new SupportEmail("user@user.com", $inquiry->email))->bcc("example@example.com", "admin@admin.com");
Run Code Online (Sandbox Code Playgroud)
小智 6
添加邮件功能(例如抄送、密件抄送和附件)的唯一方法是从通知的 toMail() 方法返回可邮寄对象。
public function toMail($notifiable){
return (new Mailable())->to($notifiable->email)->bcc($this->bcc_array);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6276 次 |
| 最近记录: |