0

I am creating a custom module, In my requirement, I've to add a custom image a, the image available under the Namespace/Moduelname/view/frontent/web/images/image.jpg.

The below code I've added image, the config variable goes to the email template.

$config['image'] = $this->assetRepo->getUrl("Magesen_ReviewReminder::images/reminder.jpg"); 

In .HTML file I am binding the value as follows.

<img width="600" src="{{view url='{{trans "%image" image=$image}}'}}" alt="Review Reminder"/> 

But unfortunately, I am unable to see the image in email, for your further reference I've attached the email images(Review Reminder image is not showing).

What is the right way to show the image to an email template?

enter image description here

1
  • I tried above solution not working, Is there any way to add Imag url to html file? Commented Jul 23, 2021 at 19:06

1 Answer 1

-1

If this is a custom email then in transportbuilder add

$transport = $this->_transportBuilder ->setTemplateVars([

 'image'=> $image ]); 

Use this in Email Template:

<img src="{{var image }}" style"width:200px;"> 
1
  • I tried the above way, but still, the image is not showing Commented Apr 28, 2020 at 7:43

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.