使用ResetPassword通知电子邮件模板进行自定义电子邮件

时间:2017-01-24 13:32:17

标签: php laravel

我通过artisan命令生成了一个新的电子邮件对象,以通知用户有关累积通知的信息。我通过Email对象的构建方法成功使用了自定义模板:

public function build()
{
    return $this->view('email.cumulative-notifications')
        ->with(['amount' => $this->amount])
        ->subject('You have some notifications!');
}

我想使用用于重置密码电子邮件的模板,该模板可以填充行和ResetPassword之类的链接:

public function toMail($notifiable)
{
    return (new MailMessage)
        ->subject('Reset Password')
        ->greeting('Hello!')
        ->line('...')
        ->action('Reset Password', url('password/reset', $this->token))
        ->line('...');
}

我应该使用Notifications对象而不是电子邮件吗?

0 个答案:

没有答案
相关问题