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

2 Answers 2


I tried above solution not working, Is there any way to add Imag url to html file?


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;">
  • I tried the above way, but still, the image is not showing
    – senthil
    Commented Apr 28, 2020 at 7:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.