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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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