Jump to content

image not showing in email template


Recommended Posts

Hi 

 

 

I have make changes on the email template by adding an image

below is the code

 

<img src="{$img_ps_dir}/myimage.jpg" />

I have double comfirm that myimage.jpg is inside the correct path. but still now showing the image in email. 

 

I have search whole day on why image not showing in email template. is because of the cdi:swift code.

how can i know my cdi:swift code of myimage.jpg? 

or is there another way to do?

 

Thanks & Regards

Kenny

 

Link to comment
Share on other sites

Hi PrestaNitro,

 

Let said myimage.jpg is inside my img folder and the myimage.jpg path is www.mydomain.com/img/myimage.jpg

 

$template_vars['{shop_url}'] = Context::getContext()->link->getPageLink('index', true, Context::getContext()->language->id);

 

how can i create the template_vars where myimage.jpg is in img folder. I have little knowledge on pretashop. could you help me?

 

Thanks & regards

Kenny

Edited by kennyjack (see edit history)
Link to comment
Share on other sites

Hi PrestaNitro,

 

It seem like by putting path to retrieve image and showing on email template <img src="{shop_url}/img/myimage.jpg" /> does not work.

 

email template does not accept the path to show image. it must use cdi:swift code to display. but i still no idea how can i get cdi:swift code of myimage.jpg

 

Regards

Link to comment
Share on other sites

Hi PrestaNitro,

 

It seem like by putting path to retrieve image and showing on email template <img src="{shop_url}/img/myimage.jpg" /> does not work.

 

email template does not accept the path to show image. it must use cdi:swift code to display. but i still no idea how can i get cdi:swift code of myimage.jpg

 

Regards

Since {shop_url} is not a valid tag to access "img" folder, the idea was to create your own mail template var, something like:

$template_vars['{my_img_folder}'] = $smarty->tpl_vars['img_ps_dir']->value;

And then use in your email the new template var:

<img src="{my_img_folder}/myimage.jpg" /> 

 

Best regards,

PrestaNitro

Link to comment
Share on other sites

×
×
  • Create New...