Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

product image in email sent via "Tell a Friend"


Guest

Recommended Posts

I got my site to send out html based emails, designed just the way I want. It then occured to me, that showing the products' image in the emails sent y friends, will greatly increase the change of the receiver entering the site to see more info on it.

 

I tryed making the needed modifications myself, but it seems like I could use a hand - this is what I've done:

 

in catalog/tell_a_friend.php find

$product_info_query = tep_db_query("select pd.products_name from

and add the image address:

$product_info_query = tep_db_query("select pd.products_name, p.products_image from

 

next, find

      if (tep_not_null($message)) {
       $email_body .= $message . "\n\n";
     }

and after it, I added:

// Show product image in email BOF
       $email_body .= tep_image(HTTP_CATALOG_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . "\n";
// Show product image in email EOF

For some reason or another, this doesn't work. I (accidentaly) tried:

// Show product image in email BOF
       $email_body .= tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . "\n";
// Show product image in email EOF

(calling the image without the path leading to it), and in the email I got a broken image. In other words, it kinda worked.

 

Do any of you know why it doesn't work when I add the "HTTP_CATALOG_SERVER . DIR_WS_CATALOG ."? I'm sure this could be easily fixed, I just don't know how.

and it's almost 02 AM. I gotta get some sleap. man... :blink:

 

-Ethan

Link to comment
Share on other sites

C'mon, guys!

I'm sure some of you could find this useful, and might even be able to help me here!

Think of it: instead of just a long URL, the receiving user will see an image of the recomended product. I think this alone would bring more traffic to the site!

 

help?

 

-Ethan

Link to comment
Share on other sites

Hi y'all,

I got it to work (no thatnks to you guys? what's with the team spirit?! :))

Anyway, here's the code I used:

// Show product image in email BOF
       $email_body .= tep_image(HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . "\n";
// Show product image in email EOF

Simply place that in catalog/tell_a_friend.php under

      if (tep_not_null($message)) {
       $email_body .= $message . "\n\n";
     }

 

Hope this helps someone,

-Ethan

Link to comment
Share on other sites

I just tried five different variations of your mod and couldn't get any of the m to send the image with it. I don't claim to be a programer so I'm not very adept at php.. Just what were the steps you took to make this work?

Thanks

Link to comment
Share on other sites

Do you have your site sending out HTMP messages or plain text?

If it's plain text, you'll have to change that. It's a little work on several files. Try to look for info about it on these forums. When I have time (somewhere in 2012), I will write a how-to about how to make the emails sent out formatted in HTML the way you want it to look.

 

-Ethan

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...