I am trying to use a built-in application in laravel mail, but it seems unsuccessful. I also tried this one , but it doesn’t work, inserting raw data. I have a base 64 image / png here an example of this.
Now I'm trying to use attachData, but how to transfer ->attachDatato mine mailtransaction.blade. I supposedly get attachData from my controller, but which variable should I name?
controller.php
Mail::send(['html'=>'mailtransaction'], $data_content, function($msg) use ($to, $issueType, $base64){
$msg->to($to);
$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>
source
share