У меня есть автоматическая электронная почта на Laravel PHP, которая информирует пользователя о том, что срок действия определенного продукта истек.
Я хотел бы включить изображение base64, которое должно быть встроено в само письмо.
Можно ли встраивать изображения base64 в электронное письмо с уценкой с помощью Laravel?
Если да, то как?
Ниже приведен шаблон блэйда для уценки по электронной почте:
@component('mail::message')
![Logo][logo]
[logo]: {{asset('frontend/img/core-img/logo-dark.png')}} "Logo"
**Product Expiry**
Dear {{$userName}},
This is to inform you that your product **{{$listingName}}**.
Your item was removed from the Market Place. Should you wish to re-list the item kindly do so from the app.
![alt]{{$listingImage}}
Should you require any information or need professional assistance kindly get in touch:
@component('mail::button', ['url' => ''])
Contact Us
@endcomponent
Thanks,<br>
# **{{ config('app.name') }} Team**
![App Icon|100x100]({{asset('frontend/img/core-img/app-logo.png')}})
@endcomponent
икласс для этого шаблона электронной почты:
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class ListingExpiryEmail extends Mailable
{
use Queueable, SerializesModels;
protected $user_name;
protected $listing_name;
protected $listing_image;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct($user_name, $listing_name, $image)
{
$this->user_name = $user_name;
$this->listing_name = $listing_name;
$this->listing_image = $image;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->subject('MyHurryApp Listing Expiry')->markdown('emails.listings.listingexpiryemail', [
'userName' => $this->user_name,
'listingName' => $this->listing_name,
'listingImage' => $this->listing_image
]);
}
}
Спасибо