jorgemirat Posted December 12, 2005 Posted December 12, 2005 The standard order status change notification in OSC2.2 sends always the same email and just changes a few fields. This is not flexible enough in many cases as some particular statuses might need completely different email text. For example a status "waiting for bank transfer" might need an email indicating all the bank account details. This module provides exactly that additional functionality. Now in the order status configuration in admin, it is possible to assign an email format file to each order status. The email format file will contain the HTML to send. This file can also contain PHP variables so the mail can have "live" data. You can also have different email formats for different languages. Additionally, if no format file is defined the standard OSC email for status change is used. The package contains the needed changes needed to the standard OSC files and a sample email format file. The format files should be created on adminincludeslanguages<your_language> I hope you enjoy it! Jorge Mirat Quote Jorge
jorgemirat Posted December 12, 2005 Author Posted December 12, 2005 You can find the contribution at http://www.oscommerce.com/community/contri...s+change+emails Quote Jorge
gregy Posted December 13, 2005 Posted December 13, 2005 hi .. can you please reply (here to my post that was already opened the other day .. when this one was not opened yet ;) my post is here thanx p.s. great contribution . helped a lot! Quote
jorgemirat Posted December 13, 2005 Author Posted December 13, 2005 The question in the other forum was: Hi! How can i insert more variables into "template" in inprocess.php I would like to add some additional info i.e. - date ordered .. not shipped .. possibly time .. - present date (today) - in our language there is different word for he and she (at registration they need to tick wether man or woman .. so why not say Dear mrs. Angelina or Dear mr. Joe .. if we have in database what sex is customer? any idea? It's relatively easy: In orders.php search for: $str_shop = STORE_NAME; The next line reads: //JORGE 20050819 If you need more information in the email just use available variables on current scope // or prepare here new ones from function calls, db queries, etc... So you just need to follow the instructions in the comment above :-) For example, to add todays date to the mail add in orders.php $todays_date = date("D M d Y"); And the in your mail format file you just use <?php echo $todays_date ?> where you want it to appear (php start/end optional depending on the case obviously) Quote Jorge
gregy Posted December 13, 2005 Posted December 13, 2005 thanx .. i'll try that .. and how can i call orders date . i'm no php freak or programmer :( Quote
jorgemirat Posted December 13, 2005 Author Posted December 13, 2005 (edited) thanx .. i'll try that .. and how can i call orders date . i'm no php freak or programmer :( Sorry I cannot code it for you as I have my own shop to maintain :D Tip: look for that info it should be somewhere in the orders.php file... otherwise get it from the database so you have it stored to be used in the mail format. Edited December 13, 2005 by jorgemirat Quote Jorge
Guest Posted December 27, 2005 Posted December 27, 2005 Can we send to multiple emails, not just the customer? I need other depts to know there was an order update.. Thanks, Mike Quote
darvidc Posted December 28, 2005 Posted December 28, 2005 The question in the other forum was:It's relatively easy: In orders.php search for: $str_shop = STORE_NAME; The next line reads: //JORGE 20050819 If you need more information in the email just use available variables on current scope // or prepare here new ones from function calls, db queries, etc... So you just need to follow the instructions in the comment above :-) For example, to add todays date to the mail add in orders.php $todays_date = date("D M d Y"); And the in your mail format file you just use <?php echo $todays_date ?> where you want it to appear (php start/end optional depending on the case obviously) Hi As we have varing delivery times and stocks we require a confirmation mail from each customer to confirm any changes that may have been made to his/her order. For this I'm trying to use MOSEM, which seems to work well for different statuses, although adding extra text/varables seems reasonably easy, I can't seem to get my head around adding the details of the order, shipping, taxes, delivery address and billing address though. I know that 'checkout_process.php' does this for the first confirmation mail but to just add those details to a new mail used by MOSEM seems impossible, especially to a newbie as I! Have you seen any solutions to adding these details to a MOSEM mail, or maybe you even have an example yourself you could share or just a simlpe tip to find an example elsewhere? Thanks in Advance David C Quote
gregy Posted December 29, 2005 Posted December 29, 2005 hi i'm doing some customization, and found straneg problem with "<br>" tags i.e. this code inserted into inprocess.php (never mind the language :) mind the form :) ) <html><head> <title>Vstopnice.com - Naročilo ?t. {$oID} </title></head> <body><font face=Verdana size=2><b>Spo?tovani {$check_status['customers_name']}<br></b> <br> Va?e naročilo ?t. {$oID} smo uspe?no obdelali, ter ga danes odposlali. Ker ste med postopkom nakupa imeli tudi mo?nost dodatnega sporočila, je spodaj morebitni odgovor Uredni?tva <i>{$comments}</i> <br> V primeru, da is ?elite ogledati zgodovino Va?ega nakupa, Vas vabimo, da kliknete <a href={$str_order_view_url}>TUKAJ</a>! <br> <br> ?elimo Vam obilo u?itkov, naslednjič, ko boste potrebovali vstopnice, pa nikar ne pozabite na nas</font><p> <font face=Verdana size=2><b>Uredni?tvo {$str_shop}</b> </font></p> <p><font face=Verdana size=2>Celje, dne <?php echo date ('d.m.Y') ?></font></p> </p> </body> </html> produces following html format Spo?tovani Gregor Koprivc Va?e naročilo ?t. 3857 smo uspe?no obdelali, ter ga danes odposlali. Ker ste med postopkom nakupa imeli tudi mo?nost dodatnega sporočila, je spodaj morebitni odgovor Uredni?tva V primeru, da is ?elite ogledati zgodovino Va?ega nakupa, Vas vabimo, da kliknete TUKAJ! ?elimo Vam obilo u?itkov, naslednjič, ko boste potrebovali vstopnice, pa nikar ne pozabite na nas Uredni?tvo Vstopnice.com Celje, dne ..as you can see way too much spaces between lines .. any idea!? thanx Quote
jorgemirat Posted December 29, 2005 Author Posted December 29, 2005 hi i'm doing some customization, and found straneg problem with "<br>" tags i.e. this code inserted into inprocess.php (never mind the language :) mind the form :) ) produces following html format ..as you can see way too much spaces between lines .. any idea!? thanx Yes actually I corrected this problem a few days ago on my own format files. Just delete the <br>!!! And the line breaks you put on the string will be the same you see on the mails! :-) Quote Jorge
gregy Posted December 29, 2005 Posted December 29, 2005 i understand that .. but that way i cannot design my form in frontpage (html editor ) :) Quote
jorgemirat Posted December 29, 2005 Author Posted December 29, 2005 Can we send to multiple emails, not just the customer? I need other depts to know there was an order update.. Thanks, Mike Yes, if you search in admin/orders.php for //JORGE 20050819 (ORDERSTATUSMAIL) And we add a bit more of flexibility to the mail subject $email_subject = sprintf(EMAIL_TEXT_SUBJECT,$oID,$orders_status_array[$status]); tep_mail($check_status['customers_name'], $check_status['customers_email_address'], $email_subject, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); You can add other email addresses on the line sending the mail (tep_mail...) like in tep_mail($check_status['customers_name'], $check_status['customers_email_address'], $email_subject, $email.';'.$additional_emails, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); I recommed that you retrive $additional_emails from the database, although it will be quicker for you to hack in the code those additional emails. I have not tested it, so not sure if the character to join emails is the ";" I put on the example or the ",". Good luck! Quote Jorge
jorgemirat Posted December 29, 2005 Author Posted December 29, 2005 i understand that .. but that way i cannot design my form in frontpage (html editor ) :) errr... yes, you are right, when I have time I'll get to improve it. It is a bit annoying for me also. In the mean time, try in your editor to replace the <br> character with an "empty" character to remove the additional br's. Quote Jorge
gregy Posted December 29, 2005 Posted December 29, 2005 thanx .. at the moment i have to clean snow in fornt of our house .. it's snowing for 4 days now, about 50cm of snow .. so our mainly job these days is .. correct .. cleaning the snow :) i'm looking forward for upgrades :thumbsup Quote
Guest Posted December 29, 2005 Posted December 29, 2005 Yes, if you search in admin/orders.php for //JORGE 20050819 (ORDERSTATUSMAIL) And we add a bit more of flexibility to the mail subject $email_subject = sprintf(EMAIL_TEXT_SUBJECT,$oID,$orders_status_array[$status]); tep_mail($check_status['customers_name'], $check_status['customers_email_address'], $email_subject, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); You can add other email addresses on the line sending the mail (tep_mail...) like in tep_mail($check_status['customers_name'], $check_status['customers_email_address'], $email_subject, $email.';'.$additional_emails, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); I recommed that you retrive $additional_emails from the database, although it will be quicker for you to hack in the code those additional emails. I have not tested it, so not sure if the character to join emails is the ";" I put on the example or the ",". Good luck! How about if I just wanted the store owner to get a copy?? Thanks, Mike Quote
jorgemirat Posted December 29, 2005 Author Posted December 29, 2005 How about if I just wanted the store owner to get a copy?? Thanks, Mike Then just use this line: tep_mail($check_status['customers_name'], $check_status['customers_email_address'], $email_subject, $email.';'.STORE_OWNER_EMAIL_ADDRESS, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); Again I'm not sure if the separator between emails should be ";" or ",". Try it. Quote Jorge
mr_absinthe Posted December 30, 2005 Posted December 30, 2005 Jorge, I was pleased to find your contribution, it's exactly what I would need in my shop. Well done! My admin/orders.php has been already modified by PWA and other contributions and I'm currently stuck on email part of it. Would you be so kind as to have a look at the following code and tell me how to implement your change while keeping the PWA? I'm not concerned about email subject because your contribution covers that as well. // start pwa changes + changes for email subject + html link in email $pwa_check_query= tep_db_query("select purchased_without_account from " . TABLE_ORDERS . " where orders_id = '" . tep_db_input($oID) . "'");$pwa_check= tep_db_fetch_array($pwa_check_query); if ($pwa_check['purchased_without_account'] != '1'){ $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . "<a HREF='" . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "'>" . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "</a>\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]); } else { $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]); } tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT_1. $oID . EMAIL_TEXT_SUBJECT_2 . $orders_status_array[$status], $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); $customer_notified = '1'; } Thanks a lot and happy new year! Alex Quote Absinthe Original Liquor Store
jorgemirat Posted December 30, 2005 Author Posted December 30, 2005 Jorge, I was pleased to find your contribution, it's exactly what I would need in my shop. Well done! My admin/orders.php has been already modified by PWA and other contributions and I'm currently stuck on email part of it. Would you be so kind as to have a look at the following code and tell me how to implement your change while keeping the PWA? I'm not concerned about email subject because your contribution covers that as well. // start pwa changes + changes for email subject + html link in email $pwa_check_query= tep_db_query("select purchased_without_account from " . TABLE_ORDERS . " where orders_id = '" . tep_db_input($oID) . "'");$pwa_check= tep_db_fetch_array($pwa_check_query); if ($pwa_check['purchased_without_account'] != '1'){ $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . "<a HREF='" . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "'>" . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "</a>\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]); } else { $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]); } tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT_1. $oID . EMAIL_TEXT_SUBJECT_2 . $orders_status_array[$status], $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); $customer_notified = '1'; } Thanks a lot and happy new year! Alex Can you tell me where you are stuck at exactly? To understand the problem I'll need to see the full file and pwa contry, but I don't have the time. By the way, why do you need the pwa contry? I implemented a solution in my shop so that customers register themselves without knowing! When they click on checkout, if they are not logged in yet, they are asked for their personal details to complete the order (but in fact is to get registered), then I send an email with their user name (email) and a randomly generated password to them. If they had purchased already in the shop they also have a link to log in. If works perfectly for me. An additional benefit is that I get email addresses of potential customers that don't complete the purchase which I can use to send them bulletins (if they have clicked on that option). Isn't there a similar contry already? If there isn't one may be I can package it as a new one (if I have time!) Cheers, Jorge. Quote Jorge
mr_absinthe Posted December 31, 2005 Posted December 31, 2005 Jorge, in your instructions there is, SEARCH FOR: $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']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]); it is line 50 in the original file, however in my modified file, the part beginning with $email = STORE_NAME is twice there: // start pwa changes + changes for email subject + html link in email $pwa_check_query= tep_db_query("select purchased_without_account from " . TABLE_ORDERS . " where orders_id = '" . tep_db_input($oID) . "'");$pwa_check= tep_db_fetch_array($pwa_check_query); if ($pwa_check['purchased_without_account'] != '1') { $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . "<a HREF='" . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "'>" . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "</a>\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]); } else { $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]); It looks like I need to replace the middle part (if I'm guessing right) of the above code with your code, but will it work fine if I change it to this? $pwa_check_query= tep_db_query("select purchased_without_account from " . TABLE_ORDERS . " where orders_id = '" . tep_db_input($oID) . "'");$pwa_check= tep_db_fetch_array($pwa_check_query); if ($pwa_check['purchased_without_account'] != '1'){ //JORGE 20050819 (ORDERSTATUSMAIL) If we have a notification mail file use it, otherwise send standard mail if ( tep_not_null($orders_notification_email_array[$status]) ) { $languages = tep_get_languages(); $language_directory = ''; for ($i=0, $n=sizeof($languages); $i<$n; $i++) { if ((int)$languages[$i]['id']==(int)$languages_id){ $language_directory = $languages[$i]['directory']; } } $filename = DIR_FS_ADMIN .'/'.DIR_WS_LANGUAGES . $language_directory .'/'. $orders_notification_email_array[$status]; //JORGE 20050819 Prepare this 'complex' info into a single variable so it is easier to use in the email formating $str_order_view_url = tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, "order_id=" . $oID, "SSL"); //JORGE 20050819 Apparently constants need to be stored first into a variable so it can be used in the email formatting $str_shop = STORE_NAME; //JORGE 20050819 If you need more information in the email just use available variables on current scope // or prepare here new ones from function calls, db queries, etc... $payment = MODULE_PAYMENT_MONEYORDER_PAYTO; include ($filename); } else { //$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']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]); $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . HTTPS_CATALOG_SERVER .'/'. FILENAME_CATALOG_ACCOUNT_HISTORY_INFO.'?order_id=' . $oID. "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]); } else { $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]); My store is live, therefore it's quite difficult for me to implement something without being sure it's going to work. Thanks a lot for your help. With regards to PWA, about 20% of my customers are using it, they prefer it that way, I guess they don't like to register. I would however like to change the whole checkout process, there are too many clicks at the moment. This Fast Easy Checkout looks quite promising, I'm sure that your knowledge could be well used there! :thumbsup: Alex Quote Absinthe Original Liquor Store
jorgemirat Posted December 31, 2005 Author Posted December 31, 2005 Hi, I understand a bit more the issue now. Apparently the only difference between the pwa email on the standard OSC email is that the pwa email adds the following information: EMAIL_TEXT_INVOICE_URL . ' ' . "<a HREF='" . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "'>" . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "</a>\n" . I don't know well the pwa contribution but it seems that it adds to the body of the mail an URL to retrieve the invoice. In that case, I think that the best option you have is to use my contribution to both orders without account and orders with accounts. Store the invoice url in a variable that you can use on the mail format file. That way, if a user buys with account that variable will be empty and the invoice url will not be shown, but if the user doesn't have an account his invocie url will be shown. That is in the case that you have a mail format file defined for the status in question, if there is none then you need to keep using the original code with the two options pwa and non-pwa. I'll put some code with how I think it should be: //JORGE 20050819 (ORDERSTATUSMAIL) If we have a notification mail file use it, otherwise send standard mail if ( tep_not_null($orders_notification_email_array[$status]) ) { $languages = tep_get_languages(); $language_directory = ''; for ($i=0, $n=sizeof($languages); $i<$n; $i++) { if ((int)$languages[$i]['id']==(int)$languages_id){ $language_directory = $languages[$i]['directory']; } } $filename = DIR_FS_ADMIN .'/'.DIR_WS_LANGUAGES . $language_directory .'/'. $orders_notification_email_array[$status]; //JORGE 20050819 Prepare this 'complex' info into a single variable so it is easier to use in the email formating $str_order_view_url = tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, "order_id=" . $oID, "SSL"); //JORGE 20050819 Apparently constants need to be stored first into a variable so it can be used in the email formatting $str_shop = STORE_NAME; //JORGE 20051231:Mods to adapt it to the pwa for mr_absinthe $invoice_url = ''; if ($pwa_check['purchased_without_account'] != '1'){ //Store the invoice url generated when pwa so it can be shown in the email. $invoice_url = EMAIL_TEXT_INVOICE_URL . ' ' . "<a HREF='" . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "'>" . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "</a>\n"; //JORGE 20051231: END } //JORGE 20050819 If you need more information in the email just use available variables on current scope // or prepare here new ones from function calls, db queries, etc... $payment = MODULE_PAYMENT_MONEYORDER_PAYTO; include ($filename); } else { // start pwa changes + changes for email subject + html link in email $pwa_check_query= tep_db_query("select purchased_without_account from " . TABLE_ORDERS . " where orders_id = '" . tep_db_input($oID) . "'"); $pwa_check= tep_db_fetch_array($pwa_check_query); if ($pwa_check['purchased_without_account'] != '1'){ $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . "<a HREF='" . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "'>" . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "</a>\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]); } else { $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]); I think that should be all! I TIP to do changes on a live shop: What I do is to create a _test.php file, for example, if I want to modify orders.php I create a copy called orders_test.php. This some times involves also renaming references to the original file inside the file (FILENAME_ORDERS) to the new test file (orders_test.php). Then I do the changes and tests on that file. When everything works fine I rename the references inside the file from orders_test.php to FILENAME_ORDERS (or whatever file is), I backup the old orders.php and rename the orders_test.php to orders.php. This way you changed the live shop without disrupting your users (well, may be a couple of seconds whilst backingup the old file and renaming the new file). Quote Jorge
jorgemirat Posted December 31, 2005 Author Posted December 31, 2005 (edited) As the code gets quite uggly here I'll add to the contribution site a file for you to test. Let me know if it works and I'll make it an option for the contri. Jorge. Edited December 31, 2005 by jorgemirat Quote Jorge
Guest Posted December 31, 2005 Posted December 31, 2005 Then just use this line: tep_mail($check_status['customers_name'], $check_status['customers_email_address'], $email_subject, $email.';'.STORE_OWNER_EMAIL_ADDRESS, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); Again I'm not sure if the separator between emails should be ";" or ",". Try it. Thanks! I tried this and it just added the store owner email in the body of the email prepended with a , or ; So I tried adding it in the brackets at $check_status['customers_email_address'], but came up with errors. I even tried removing the 'customers_email_address' and adding 'STORE_OWNER_EMAIL_ADDRESS' but it didn't send anything. Any Ideas? And for the record I sincerely appreciate the help! Mike Quote
Guest Posted January 1, 2006 Posted January 1, 2006 Then just use this line: tep_mail($check_status['customers_name'], $check_status['customers_email_address'], $email_subject, $email.';'.STORE_OWNER_EMAIL_ADDRESS, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); Again I'm not sure if the separator between emails should be ";" or ",". Try it. Hey jorge! I found the answer. In case you are interested see this post: http://www.oscommerce.com/forums/index.php?sho...28entry768128 Thanks, Mike Quote
mr_absinthe Posted January 2, 2006 Posted January 2, 2006 Hi, I understand a bit more the issue now. I don't know well the pwa contribution but it seems that it adds to the body of the mail an URL to retrieve the invoice. Jorge, I didn't have time to test it yet, but the main difference is if you purchase using PWA, you will not have an account and also NO link to detailed invoice in email. If you create an account, link to detailed invoice is displayed in the email order confirmation. Alex Quote Absinthe Original Liquor Store
Guest Posted January 3, 2006 Posted January 3, 2006 (edited) Hi Jorge, great contribution! thanks a bunch - just have two questions 1. is there a way that this can work with batch update status contribution - as this let's you update a group of orders at the same time from your admin/orders screen - but the email it sends when you change the status is obviously not the customised email - can this be linked somehow? 2. I would love to just have a live link to the order history in the emails received by my clients - all I seem to get is a link that is not a hotlink but that has to be cut and pasted into a browser to get them there - is it possible to do a href to the order history link at all - as double quotes don't work in the script I wonder if there is a work around? cheers! Maria Edited January 3, 2006 by scrapart Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.