lundi 30 décembre 2019

Multiple files view in email template laravel

I have an array of image path to attach with email. How can i view them in a email template?

SendMailController:

  $files = collect(json_decode($img_files))->map(function ($file) {
    return public_path('uploads' . DIRECTORY_SEPARATOR . $file->name);
  })->toArray();

  Mail::to($customer_email)->send(new SendMail($customer_firstname, $pathToFile), function($message){
        foreach ($files as $filePath) {
            $message->attach($filePath);
        }
      }
  );

In my email template:

<img src="" style="width:600px;height:335px">

But this gives, Undefined variable: filePath error. How can i this



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire