我正在尝试使用 Mailgun 发送邮件。如果我写这个:
$mg = Mailgun::create('xxxx');
$mg->messages()->send('xxxx', [
'from' => 'dmt.akyol@gmail.com',
'to' => 'dmt.akyol@gmail.com',
'subject' => 'Your Link To Login!',
'text' => 'hello',
]);
它有效,但我想发送一个视图(刀片),但我不知道该怎么做。
我的代码是:
public function build(array $customer)
{
return view('link')->with([
'customer'=> $customer,
]);
}
public function sendContactForm(array $customer)
{
$aaa=$this->build($customer);
$mg = Mailgun::create('xxxxxx')
$mg->messages()->send('xxxx'), [
'from' => $customer['customerEmail'],
'to' => ' dmt.akyol@gmail.com',
'subject' => 'Contact Message',
'html' => $aaa,
]);
}
html
这在我写或时不起作用text
。
我应该怎么办?