Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Images in Email


Recommended Posts

It would be nice if we could embed images in the automated emails that are generated. For instance you could have your logo at the top or in your signature or something.


Is there a mod that does this or does anyone know how?


I was quite surprised that there wasn't anything like this. For instance with the newsletter, an HTML newsletter is pretty average with no nice pics.


Link to comment
Share on other sites

Yes i agree with you!

I would like to also have some product fields in the e-mails that are sent. hope someone can come up with a solution.


I am not a php programmer but i was just thinking if some home when the products are ordered and the order is complete in the database the order details are there. So they are picked up and put in the e-mail..


If we could get the product info & the pic to go into the order_products table in the database then i am sure we could pick that field from the table to show in the e-mail. this i just my thought.

i anticipate we could get some help from a php/Oscommerce expert.

Link to comment
Share on other sites

I think it's a great idea actually....can't be that hard to do.....it's HTML...so instead of embedding the image, you can just link to it.....


test should be easy...think i will try it now

Link to comment
Share on other sites

Yes it easy to put a link but that's not what I mean.


I want to actually embed the image into the email so that when the customer is not connected to the net (MODEM user) then the email still has the pics in it.


Putting links in is the easy option but not what I am after.


Link to comment
Share on other sites

I am sure if we use a get code some where in that e-mail to pick up the data like it does with the product details then i am sure we can get the image of the product in as well.


looking at the code it seems to start off from the checkout_process.php page then it seems to be using the classes/order.php to do some function to put it in the database then the e-mail that is sent in on that code it seems to be getting the info from the database.. just need to figure out where to put what and how? ;) still puzzling

Link to comment
Share on other sites

Getting the data is easy, I can do that.. I just want a good example in PHP of embedding attaching images in an email. Once I have that and get an example working it shouldn't be too hard.


Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...

Hi all,


Its not hard to include images in the email by way of link!


I have included dynamic product images into my html email, the only concern is if a user is not connected to the internet when browsing the email the images dont appear.


in catalog/checkout_process.php, line 244?

if (EMAIL_USE_HTML == 'false') {


// MaxiDVD If HTML Email is disabled we send

// the customer a text email.


    $products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";


} else {


// Else if HTML is Enabled we include

// the purchased product/s images.


    $products_ordered .= tep_image(HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $order->products[$i]['image'], $order->products[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . ' ' . $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . '<br>';


This way the customer (if connected to the net) will get picture copys of the products they have order, this is a easy way if getting images into sales email, I would still be keen to see how the embedding of images could be achived in a similar fashion.


Cheers MaxiDVD :-)

Link to comment
Share on other sites

You need to setup a new database query that uses the


( orders_id = products_id ) and query the products table for the images, not sure how its done again but I found it somewhere before in the forums.


had a few drinks tonight, and cant find it :(


$get_images = tep_db_query("select p.products_image from " . TABLE_PRODUCTS . " where bah bah..


naybe someone can help wiht this query.



Link to comment
Share on other sites

Hi Matt


Here are the references that you are after


the email says this


<img src="http://www.goodvibrations.me.uk/catalog/images/"


the image says this




(I have replaced the image name with image.jpg)


any ideas







Mark A Reynolds

Link to comment
Share on other sites

Lee's correct, it's missing that info. Change (around lines 216-7 of includes/classes/order.php):

        $this->products[$index] = array('qty' => $products[$i]['quantity'],
                                       'name' => $products[$i]['name'],


        $this->products[$index] = array('qty' => $products[$i]['quantity'],
                                       'image' => $products[$i]['image'],
                                       'name' => $products[$i]['name'],



Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...