Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need Help in modifying email content


KerkChzePerng

Recommended Posts

Hi, I've problem in adding image in the email content . In catalog/checkout_process.php , around line 260 :

 

$email_order = tep_image(DIR_WS_IMAGES . 'logo.jpg', 'logo', '400', '80') . "\n" . STORE_NAME . "\n" . "THANKS FOR YOUR INTEREST IN OUR MODERN MUMMY PRODUCTS." . "\n" . "PLEASE CHECK THAT ALL THE DETAILS IN YOUR ORDER ARE CORRECT." . "\n" .

.......

 

Why the image cannot be shown in the email ?

 

Appreciate if someone can guide me , I am newbie .

Link to comment
Share on other sites

In catalog/checkout_process.php :

 

I've added tep_image(DIR_WS_IMAGES . 'logo.jpg', 'logo', '400', '80') into

 

$email_order = tep_image(DIR_WS_IMAGES . 'logo.jpg', 'logo', '400', '80') . "\n" . $email_order = STORE_NAME . "\n" .
                EMAIL_SEPARATOR . "\n" .
                EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" .
                EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" .
                EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";

 

 

// send emails to other people

  if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
   tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

Why the image cannot be shown in the email ? Please help me :'(

Link to comment
Share on other sites

have you add email address to backend->configuration->My Store-> Send Extra Order Emails To....................... for extra mail?

 

if not go to above path add email address and try to send mail.....

 

still it's not working then you have to check with EchoExit method (i called it) :)

 

go to line

 

if (SEND_EXTRA_ORDER_EMAILS_TO != '') {

 

echo "some content";exit();

 

and check it works or not.

Please take backup of your files before do changes suggested by me

Link to comment
Share on other sites

ok

 

sometime it happens that mail service provider block all image to load.

 

is there any message to block image in mail content?

 

if there is no message to load image then check view source of the mail, image content is there or not?

Please take backup of your files before do changes suggested by me

Link to comment
Share on other sites

ok

 

now EchoExit();

 

after line

 

if (SEND_EXTRA_ORDER_EMAILS_TO != '') {

 

place this code:

 

echo $email_order;exit();

 

and check (run the same process as you run usually to send mail)

 

can you see image in your mail content?

 

if not then check image is exists in correct directory or not....

Please take backup of your files before do changes suggested by me

Link to comment
Share on other sites

But if the echo is not in the tep_mail , the image absolutely will not be shown in the email isn't it ? :huh:

Besides, I've just found that i copied wrong code , the tep_mail code should be as below

 

tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_TEXT_SUBJECT, $email_order,$order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address']);

 

Any idea ?

Link to comment
Share on other sites

look

 

i have written something like this

 

$email_order = tep_image(DIR_WS_IMAGES . 'store_logo.png', STORE_NAME) . "\n" . STORE_NAME . "\n" . (same as you have done)

 

then....................

 

echo "<pre>";

echo $email_order;exit;

 

tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

i have written echo and exit to debug my process

 

and i have got result like

post-295170-0-30824900-1312897718_thumb.png

Please take backup of your files before do changes suggested by me

Link to comment
Share on other sites

i mean to say is

 

just print content of the mail before send mail function called

 

atleast we come to know what content is coming

 

just put

 

echo "<pre>";

echo $email_order;exit;

 

before mail function and check in your browser what is coming...

Please take backup of your files before do changes suggested by me

Link to comment
Share on other sites

May I know whether where should I insert these 2 lines ?

 

echo "<pre>";
echo $email_order;exit;

 

I've tried as you did, the image only appear in the checkout.php page , but in the email i've received is still without image ... :(

I'm very new to this OScommerce ....

Link to comment
Share on other sites

insert before

 

tep mail funciton like that.......

 

 

echo "<pre>";

echo $email_order;exit;

 

tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

Please take backup of your files before do changes suggested by me

Link to comment
Share on other sites

go to

 

admin/

 

configuration->E-mail options->Use MIME HTML When Sending Emails.......................... true

 

please check that is it true or not?

 

if not then switch it to true

 

another thing is...

 

may i access the site to test if i can find anything?

Please take backup of your files before do changes suggested by me

Link to comment
Share on other sites

Hi , sorry for took so long to reply , was testing . I think it works , thanks :thumbsup: ! The MIME HTML was set to 'false' , and now it is 'true' .

 

However , the email there still got problem as below :

 

http://i56.tinypic.com/10dulav.jpg

 

When i right click it and copy image URL , what i get is, http://images/logo.jpg . By right , it should be http://domain_name/images/logo.jpg , but the domain name is missing ..... :(

Link to comment
Share on other sites

$image = '<img src="http:/domain_name/images/logo.jpg">';

$email_order =  $image . "\n" . STORE_NAME . "\n" . 
                EMAIL_SEPARATOR . "\n" . 
                EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" .
                EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" .

 

I've solved it by using above code !!! :D Thanks vishalchauhan , really thanks a lot !!! :thumbsup:

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...