【发布时间】:2018-07-04 18:06:25
【问题描述】:
我需要发送电子邮件,但我已经生成了 HTML,我不想使用 laravel Blade,因为我需要将 CSS Inliner 应用到 HTML,所以这就是我生成 html 的方式:
getRenderedView($viewData) {
//code
$html = View::make('email.notification', $viewData)->render();
$this->cssInliner->setCSS($this->getCssForNotificationEmail());
$this->cssInliner->setHTML($html);
return $this->cssInliner->convert();
}
因此,要使用 Laravel 发送邮件,您通常会执行以下操作:
Mail::send('emails.welcome', $data, function($message)
{
$message->to('foo@example.com', 'John Smith')->subject('Welcome!');
});
但我不想传递视图,我已经有了 html,我该怎么做?
【问题讨论】: