Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sending Comments on Email


shahed

Recommended Posts

Posted

Hello

I like to email my user the text which I write on Comments Field when I update an order. Sometime user are too lazy to go to site and look what I put an comment. I think there are 2 solutions for that.

 

1. Create another comment field and send that field on email.

 

2. Update current script so it will include Comments field on email.

 

Can anyone help me out?????

 

Shahed

Posted

Having the comments show up in notification emails was working until I upgraded to the new Checkout Version of 2.2.

 

I am sure someone has a fix out there. I am stumped.

Jared Geesey

Posted

I agree sending the comments is a good idea, but don't see that it was ever done. The CVS shows the email notification first introduced in admin/orders v.1.71 and that part of the code is unchanged as of v.1.103.

 

Anyway, the email message is constructed at line 41. Insertion of the comment is a simple hack:

 

change admin/orders line 41 from this

$email = STORE_NAME . "n" . EMAIL_SEPARATOR . "n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "nn" . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);

to this

$email = STORE_NAME . "n" . EMAIL_SEPARATOR . "n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "nn" . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status], $comments);

 

and in admin/includes/languages/english/orders.php edit the define of EMAIL_TEXT_STATUS_UPDATE from this

define('EMAIL_TEXT_STATUS_UPDATE', 'Your order has been updated to the following status.' . "nn" . 'New status: %s' . "nn" . 'Please reply to this email if you have any questions.' . "n");

to this

define('EMAIL_TEXT_STATUS_UPDATE', 'Your order has been updated to the following status: %s' . "nn" . 'Comments:' . "n" . '%s' . "nn" . 'Please reply to this email if you have any questions.' . "n");

 

I have tested this, and my only misgiving is inclusion of the announcement "Comments:" when the comment is blank. An alternative hack will be in a following post.

Posted

If you want to quote the comment only if there is one, do this instead.

 

Replace lines 41-42 of admin/orders.php from

$email = STORE_NAME . "n" . EMAIL_SEPARATOR . "n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "nn" . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);

tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, nl2br($email), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

with this

$email = STORE_NAME . "n" . EMAIL_SEPARATOR . "n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "nn" . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);

if (tep_not_null($comments)) $email .= TABLE_HEADING_COMMENTS . ":n" . $comments;

tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, nl2br($email), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

and in admin/includes/languages/english/orders.php replace this

define('EMAIL_TEXT_STATUS_UPDATE', 'Your order has been updated to the following status.' . "nn" . 'New status: %s' . "nn" . 'Please reply to this email if you have any questions.' . "n");

with this

define('EMAIL_TEXT_STATUS_UPDATE', 'Your order has been updated to the following status: %s' . "nn");

Posted

This feature has now been implemented in the CVS, as admin/orders.php v.1.106.

Be sure to add the new defines from admin/includes/languages/english/orders.php v.1.22 (or your language).

  • 1 month later...
Posted

Thanks So Much!

 

I looked all over the forums for this..... My email comment updates werent working correctly, but now they are.

 

Thank you very much, :D

  • 4 weeks later...
Posted
This feature has now been implemented in the CVS, as admin/orders.php v.1.106.  

Be sure to add the new defines from admin/includes/languages/english/orders.php v.1.22 (or your language).

 

This is great!

I'd neet this to be 1 page earlyer in order-proces... so that the client also get the Comment he add while ordering, with the Order-confirmation-email (extra info like what text to print to this product or something...)! I try to see this, but if someone have it fixed out, please tell me too.

 

Maybe customes shoud have way to modify this Comment, before the Shop-owner have taken the Order (while the order is still "waiting").

 

Next maybe way to add some image to Order... for printing to product or something?

Archived

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

×
×
  • Create New...