Home > Blockchain >  Laravel 9 - Email model page
Laravel 9 - Email model page

Time:09-12

I'm trying to create a beautiful email model, it means the appearance of the email you can receive.

I would like to add images to decorate but it does'nt work, do you know how can I do this ?

<body>
<div >
    <img src="img/vault-tec.png" alt="76 Systems" width="740" height="729" id="logo-v" />
</div>
<h1> message : {{ $data['message'] }}</h1>
<h2> subject : {{ $data['subject'] }}</h2>
<h2> email : {{ $data['email'] }}</h2>

I saw this on Laravel 9 doc : embedData($data, 'img/vault-tec.png'); ?>"> But it doesn' work, I had an error : the body must be a string or a resource(got array)

Thanks a lot for your help !

CodePudding user response:

You can use something like that:

<img src="{{ asset('img/image.png') }}"/>

The image will be stored in that case in /public/img directory and will be loaded from assets.

CodePudding user response:

<img src="{{ $message->embed(public_path() . '/img/templates/LOGO.png') }}" />

I tried to store the image in public/img, but it's not enought we had to write the public path that way :)

  • Related