我正在尝试用Laravel发送一封简单的电子邮件.我发送普通的HTML电子邮件没有问题但是当我尝试使用降价功能时,我不断收到错误消息
Undefined variable: markdown
我现在没有在我的电子邮件中使用任何模型实例,我只是想首先获得一个简单的降价电子邮件.以下是我设置所有内容的方法.
邮件控制器
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class ProjectSubmitted extends Mailable
{
use Queueable, SerializesModels;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->markdown('emails.project-submitted');
}
}
Run Code Online (Sandbox Code Playgroud)
刀片模板
@component('mail::message')
*Lorem Ipsum Dolor
@component('mail::button', ['url' => 'http://google.com'])
Lorem Ipsum Dolor
@endcomponent
Thanks,<br>
Lorem Ipsum
@endcomponent
Run Code Online (Sandbox Code Playgroud)
这就是我现在所拥有的,非常基本的.当我尝试发送此电子邮件时
\Mail::to('example@example.com')->send( new \App\Mail\ProjectSubmitted );
我一直在收到错误Undefined variable: markdown.在这上面找不到任何东西.任何帮助都会很棒.
| 归档时间: |
|
| 查看次数: |
761 次 |
| 最近记录: |