使用mail laravel发送生成的二维码
大家好,我有一个方法,生成QRcode并发送到用户的电子邮件 但是二维码$text没有显示在电子邮件中,我不知道为什么 我制作DD($text)时的二维码 这是我的QR.php类使用mail laravel发送生成的二维码,laravel,email,qr-code,laravel-7,laravel-mail,Laravel,Email,Qr Code,Laravel 7,Laravel Mail,大家好,我有一个方法,生成QRcode并发送到用户的电子邮件 但是二维码$text没有显示在电子邮件中,我不知道为什么 我制作DD($text)时的二维码 这是我的QR.php类 class QR extends Mailable { use Queueable, SerializesModels; public $text; /** * Create a new message instance. * * @return void
class QR extends Mailable
{
use Queueable, SerializesModels;
public $text;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct($text)
{
$this->text = $text;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
// dd($this->text);
return $this->view('emails.QR');
}
}
这是我想在电子邮件中显示的视图
<div class="card">
<div class="card-body">
<h1>this is your QR code</h1>
{!! $text !!}}
</div>
</div>
这是您的二维码
{!!$text!!}
试试{!!html\u entity\u decode($text)!!}
你确定你的电子邮件客户端支持嵌入式SVG吗?生成的电子邮件中的HTML是什么样子的?@KamleshPaul不是working@miken32在我看来,它工作正常,它显示二维码
class QR extends Mailable
{
use Queueable, SerializesModels;
public $text;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct($text)
{
$this->text = $text;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
// dd($this->text);
return $this->view('emails.QR');
}
}
<div class="card">
<div class="card-body">
<h1>this is your QR code</h1>
{!! $text !!}}
</div>
</div>