[Skip to main content](#vessel-content)

#   Image in e-mail

##

- **[Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")**
- [![Lumiga's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar31479.png)](/forum/user/31479-lumiga "View Lumiga's Profile") Topic Author
- [ Offline](/forum/user/31479-lumiga)

Less More

- Posts: 643
- Thank you received: 26
-
-
-

8 years 4 months ago [\#295438](#295438) by [Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")  *[Image in e-mail](/forum/35-orders-management/895276-image-in-e-mail#295438 "-- HikaShop version -- : 3.5.0 -- Joomla version -- : 3.8.10 -- PHP version -- : 7  Hi,  I have removed the image from the table into all the e-mails but the image is still to see as an attachment in the e-mail. Which code should I adjust to prevent this?  See screenshots:  So I think I have to edit something in the Preload version. But I do not know which code I need to change since I am not a developer.  Could you please give me a hint. I think this Preload code need to be adjusted because it's the only code about images.  Hope you can help me.  Kind regards, Lumiga")* was created by *[Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")*

-- HikaShop version -- : 3.5.0
-- Joomla version -- : 3.8.10
-- PHP version -- : 7

Hi,

I have removed the image from the table into all the e-mails but the image is still to see as an attachment in the e-mail.
Which code should I adjust to prevent this?

See screenshots:

[ ![screenshot-317.jpg](/forum/attachment/44238) ](/forum/attachment/44238 "...enshot-317.jpg")

[ ![screenshot-318.jpg](/forum/attachment/44239) ](/forum/attachment/44239 "...enshot-318.jpg")

[ ![screenshot-319.jpg](/forum/attachment/44240) ](/forum/attachment/44240 "...enshot-319.jpg")

So I think I have to edit something in the Preload version. But I do not know which code I need to change since I am not a developer.

Could you please give me a hint.
I think this Preload code need to be adjusted because it's the only code about images.

Hope you can help me.

Kind regards,
Lumiga
Code:

$cartProduct = array( 'PRODUCT_CODE' =&gt; $item-&gt;order_product_code, 'PRODUCT_QUANTITY' =&gt; $item-&gt;order_product_quantity, 'PRODUCT_IMG' =&gt; '', ); if(!empty($item-&gt;images[0]-&gt;file_path) &amp;&amp; $config-&gt;get('thumbnail', 1) != 0) { $img = $imageHelper-&gt;getThumbnail($item-&gt;images[0]-&gt;file_path, array(50, 50), array('forcesize' =&gt; true, 'scale' =&gt; 'outside')); if($img-&gt;success) { if(substr($img-&gt;url, 0, 3) == '../') $image = str_replace('../', HIKASHOP_LIVE, $img-&gt;url); else $image = substr(HIKASHOP_LIVE, 0, strpos(HIKASHOP_LIVE, '/', 9)) . $img-&gt;url; $attributes = ''; if($img-&gt;external) $attributes = ' width="'.$img-&gt;req_width.'" height="'.$img-&gt;req_height.'"'; $cartProduct['PRODUCT_IMG'] = '&lt;img src="'.$image.'" alt="" style="float:left;margin-top:3px;margin-bottom:3px;margin-right:6px;"'.$attributes.'/&gt;'; } }

---

Kind regards,
Lumiga

- [ ![screenshot-317.jpg](/forum/attachment/44238) ](/forum/attachment/44238 "...enshot-317.jpg") [ ](/forum/attachment/44238?download=1 "...enshot-317.jpg")
- [ ![screenshot-318.jpg](/forum/attachment/44239) ](/forum/attachment/44239 "...enshot-318.jpg") [ ](/forum/attachment/44239?download=1 "...enshot-318.jpg")
- [ ![screenshot-319.jpg](/forum/attachment/44240) ](/forum/attachment/44240 "...enshot-319.jpg") [ ](/forum/attachment/44240?download=1 "...enshot-319.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg5NTI3Ni1pbWFnZS1pbi1lLW1haWw/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86583
- Thank you received: 14324
-
-

8 years 4 months ago [\#295452](#295452) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Image in e-mail](/forum/35-orders-management/895276-image-in-e-mail#295452 "-- HikaShop version -- : 3.5.0 -- Joomla version -- : 3.8.10 -- PHP version -- : 7  Hi,  I have removed the image from the table into all the e-mails but the image is still to see as an attachment in the e-mail. Which code should I adjust to prevent this?  See screenshots:  So I think I have to edit something in the Preload version. But I do not know which code I need to change since I am not a developer.  Could you please give me a hint. I think this Preload code need to be adjusted because it's the only code about images.  Hope you can help me.  Kind regards, Lumiga")*

Hi,

The images are embedded in the emails only if you have the "Embed images" setting activated in the HikaShop configuration.
The way it works is that the email sending process in class.mail will scan the HTML of the email, and when it finds an img tag, it will take the image URL and load its content in the email.

So the issue is that the img tag is still in the HTML of the email. Instead of &lt;!-- and --&gt; to add HTML comments around the img tag (which cannot be detected by the email sending process) you should completely remove the tag {LINEVAR:PRODUCT_IMG}.
That way, you would get the img tag in the HTML of the email at all and thus the image wouldn't be embedded.
An alternative is simply to turn off the "Embed images" setting.
Finally, you could also keep it like you have it and change the line: Code:

$cartProduct['PRODUCT_IMG'] = '&lt;img src="'.$image.'" alt="" style="float:left;margin-top:3px;margin-bottom:3px;margin-right:6px;"'.$attributes.'/&gt;';

to: Code:

$cartProduct['PRODUCT_IMG'] = '';

in the preload to actually not add the img tag even if you have the {LINEVAR:PRODUCT_IMG} tag in the HTML version.

The following user(s) said Thank You: [Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg5NTI3Ni1pbWFnZS1pbi1lLW1haWw/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.055 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
