php - Is it possible to include an image in a HTML email in Laravel -
i'm trying send html email via laravel's mail::send()
. view in i'm using blade template, i'm not quite sure on how go including image in body of email.
in template, have
<h4>you have updated session!</h4> @if ( $old_date != $date) <p>you have changed {{ $old_date }} {{ $date }}</p> @endif <p>if have questions or concerns, please contact office of admissions</p> {{ html::image('/images/full-logo.png', 'logo') }}
however, email comes out broken link icon in body of email. possible pass image parameter view? in controller sends email, have
$data = array ( 'first_name' => $student->first_name, 'last_name' => $student->last_name, 'date' => $day, 'old_date' => $old_day, ); mail::send ( '/emails/create_student', $data, function ($message) { ... } );
so i'm not sure if might possible include image via $data
array.
html::image()
generates absolute path image, this:
http://yoursite.dev/image.png
which works in local environment.
mail client, gmail, override image path this:
http://images.gmail.com/?src=http://yoursite.dev/image.png
obviosly 3rd party service can't access local domain , see broken image.
as solution, can upload images 3rd party service amazon aws , pass link uploaded image email template.
Comments
Post a Comment