【发布时间】:2018-01-29 10:03:09
【问题描述】:
我正在尝试在 laravel 邮件中使用内联附件,但似乎很不幸。我也试过这个one,但不能通过嵌入原始数据来工作。我有一个 base 64 图像/png,这里是一个 example。
现在我正在尝试使用 attachData,但如何将 ->attachData 传递给我的 mailtransaction.blade。我应该从我的控制器中获取 attachData,但我应该调用什么变量?
控制器.php
Mail::send(['html'=>'mailtransaction'], $data_content, function($msg) use ($to, $issueType, $base64){
$msg->to($to); // change this upon finishing
$msg->attachData($base64, 'test.png', ['mime'=>'image/png']);
$msg->subject($issueType);
});
mailtransaction.blade
<!DOCTYPE html>
<html>
<head>
</head>
<body style="width:100%;">
<div style="border:0px solid #000; width:1000px !important;">
<div style="display: inline-block;">
<img src="{{$message->embed('storage/app/public/images/logo.png')}}" height="50px" width="50px">
</div>
<div style="display: inline-block; vertical-align: top;">
<div style="font-size:24px; margin-bottom: -10px;">Fraud Detection Tool</div>
<div>Suspicious Transaction details</div>
</div>
<hr style="border:0px; border-bottom:1px solid #000; width:1000px;">
<div class="container">
{{$msg}}
//I supposedly get the attachData from my controller but what variable should I call?
</div>
<hr style="width:1000px;">
<div class="container_mail" style="width:600px !important;">
<img src="{{}}" height="auto" style="max-width: 1000px">
</div>
</div>
</body>
</html>
【问题讨论】:
-
会不会是因为
use没有传入$request? -
@clod986 我编辑了我的问题,是的,它应该在使用中,但我的问题是我怎么能调用它 ->attachData 来传递我的邮件 vue