从MailMessage传递变量到通知邮件刀片模板

  • 本文关键字:通知 MailMessage 变量 laravel
  • 更新时间 :
  • 英文 :


是否可以将foo变量传递给MailMessage:

return (new MailMessage)
->subject('Hello : ' . __('Verify Email Address'))
->line(__('Please click the button below to verify your email address.'))
->action(__('Verify Email Address'), $verificationUrl)
->line(__('If you did not create an account, no further action is required.'));

,以便在resources/views/vendor/notifications/email.blade.php模板文件的任何地方使用它:

{{ foo }}

yes you can:

,

Mail::to($email)
->send(new NotifiyNewOrder($datayouwanttopass));

和:

public $datayouwanttopass;
public function __construct($datayouwanttopass)
{
$this->datayouwanttopass = $datayouwanttopass;
}

public function build()
{
return $this->
from('set the sender email')
->subject('subject')
->view('the view here.');
}

最新更新