如何设置 Laravel 通知的回复地址?
How to set replyTo address for Laravel notifications?
我正在
"Call to undefined method Illuminate\Notifications\Messages\MailMessage::replyTo() in ... /TeamMessage.php:68"
我试图在 TeamMessage.php 中为这样的通知设置回复地址:
public function toMail($notifiable)
{
return (new MailMessage)
->replyTo('myemail@gmail.com', 'My Name')
->line($this->custom_message)
}
我猜这里无法设置 header 信息?还有其他方法吗?我正在使用 https://laravel.com/api/5.3/Illuminate/Notifications/Messages/MailMessage.html
中描述的 replyTo() 方法
编辑 添加一些说明:我需要能够动态设置 reply-to 地址,因此无法在某处的配置中对其进行硬编码.
这个错误毫无意义。此方法存在于 MailMessage 中,唯一有意义的是您的存储库版本中缺少该方法。 replyTo()
有点新(2016 年 11 月),你也是
composer update
?
这是相关的提交:
https://github.com/laravel/framework/commit/484cfcbdb381e8f36510030b086884e49b898e87
我正在
"Call to undefined method Illuminate\Notifications\Messages\MailMessage::replyTo() in ... /TeamMessage.php:68"
我试图在 TeamMessage.php 中为这样的通知设置回复地址:
public function toMail($notifiable)
{
return (new MailMessage)
->replyTo('myemail@gmail.com', 'My Name')
->line($this->custom_message)
}
我猜这里无法设置 header 信息?还有其他方法吗?我正在使用 https://laravel.com/api/5.3/Illuminate/Notifications/Messages/MailMessage.html
中描述的 replyTo() 方法编辑 添加一些说明:我需要能够动态设置 reply-to 地址,因此无法在某处的配置中对其进行硬编码.
这个错误毫无意义。此方法存在于 MailMessage 中,唯一有意义的是您的存储库版本中缺少该方法。 replyTo()
有点新(2016 年 11 月),你也是
composer update
?
这是相关的提交:
https://github.com/laravel/framework/commit/484cfcbdb381e8f36510030b086884e49b898e87