Is it possible to have 2 different Order Confirmation emails, one that is sent to the customer and one that is sent to the store manager/admin?
Thanks.
Is it possible to have 2 different Order Confirmation emails, one that is sent to the customer and one that is sent to the store manager/admin?
Thanks.
Did my post help you fix something? You can show your gratitude by buying the the dev team coffee.
Hi Scoolboy.
Perhaps I didn't make myself clear. I want to send two different confirmation emails, not send a single email to two different people. The CP seems to only let you do the latter.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donations always welcome: www.zen-cart.com/donate
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
DrByte.
Thanks for the reply. I figured I'd probably have to do some coding to have this done. Can you tell me which file(s) I will need to modify?
Thanks.
Order-Confirmation emails are generated in the orders.php class file.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donations always welcome: www.zen-cart.com/donate
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Hi DrByte.
Again, thanks for the reply. I found the order.php file under classes, and it definitely looks like the one I need to modify. One question, it doesn't look like there's an override function for the classes files. Can I create one by just copying the order.php file into a classes/<my template> folder?
Again, thanks.
Regards.
You're right, there is no override for the classes ... but there is an override possibility using an "observer". If you look in the order.php file, towards the bottom is the function send_order_email. Within that function there are two "notifiers" that it raises; the one you'd be interested in is NOTIFY_ORDER_INVOICE_CONTENT_FOR_ADDITIONAL_EMAILS, which is raised just before the "admin/extra" email is sent. You could write an "observer" that is invoked when the notifier is raised and perform your custom processing without changing any core files. The wiki documentation is here: http://www.zen-cart.com/wiki/index.p..._API_Tutorials.
The COWOA plugin makes use of an observer class to do its business and might help to guide you.
Hi lat9.
Thanks for the reply. I appreciate the info and will look into using a notifier. Fortunately, I managed to create the new "owner's email" within the order.php file (and, yes, I made a backup first).
You might be able to help me with a minor problem, if you would be so kind.
The original email contained 3 items: a disclaimer, a copyright notice and an anti-spam notice. They looked like this:
In the code for the new email, I commented out what I thought were the lines that generated these, so the section looks like this:Code:----- This email address was given to us by you or by one of our customers. If you feel that you have received this email in error, please send an email to crazy@alongcrazyalley.com ----- Copyright (c) 2012 Along Crazy Alley. Powered by Zen Cart This email is sent in accordance with the US CAN-SPAM Law in effect 01/01/2004. Removal requests can be sent to this address and will be honored and respected.
The resulting email section now looks like this:Code:/* // include disclaimer $email_order .= "\n-----\n" . sprintf(EMAIL_DISCLAIMER, STORE_OWNER_EMAIL_ADDRESS) . "\n\n"; // include copyright $email_order .= "\n-----\n" . EMAIL_FOOTER_COPYRIGHT . "\n\n"; */ while (strstr($email_order, ' ')) $email_order = str_replace(' ', ' ', $email_order); $html_msg['EMAIL_FIRST_NAME'] = $this->customer['firstname']; $html_msg['EMAIL_LAST_NAME'] = $this->customer['lastname']; // $html_msg['EMAIL_TEXT_HEADER'] = EMAIL_TEXT_HEADER; $html_msg['EXTRA_INFO'] = ''; $zco_notifier->notify('NOTIFY_ORDER_INVOICE_CONTENT_READY_TO_SEND', array('zf_insert_id' => $zf_insert_id, 'text_email' => $email_order, 'html_email' => $html_msg)); // zen_mail($this->customer['firstname'] . ' ' . $this->customer['lastname'], $this->customer['email_address'], EMAIL_TEXT_SUBJECT . EMAIL_ORDER_NUMBER_SUBJECT . $zf_insert_id, $email_order, STORE_NAME, EMAIL_FROM, $html_msg, 'checkout', $this->attachArray); zen_mail('', SEND_EXTRA_ORDER_EMAILS_TO, 'NEW ORDER' . ' ' . EMAIL_ORDER_NUMBER_SUBJECT . $zf_insert_id, $email_order, STORE_NAME, EMAIL_FROM, $html_msg, 'checkout_extra', $this->attachArray); } $zco_notifier->notify('NOTIFY_ORDER_AFTER_SEND_ORDER_EMAIL'); }
You'll notice that the copyright statement is gone, but the other 2 are still there. Any idea where/how they're being generated?Code:This email address was given to us by you or by one of our customers. If you feel that you have received this email in error, please send an email to crazy@alongcrazyalley.com This email is sent in accordance with the US CAN-SPAM Law in effect 01/01/2004. Removal requests can be sent to this address and will be honored and respected.
Anyway, thanks for your help.
BTW, in your reply you said to look for the notifier: NOTIFY_ORDER_INVOICE_CONTENT_FOR_ADDITIONAL_EMAILS. No such notifier is in the copy of order.php that I have. No biggie, just FYI.
Regards.
I think I remember seeing some "issues" with bracketing comments around line comments; try this instead:
Note that the bracketing comment starts on a line before the line (//) comment. The notifier constant that I mentioned is in the v1.5.0 version of order.php.Code:/* // include disclaimer $email_order .= "\n-----\n" . sprintf(EMAIL_DISCLAIMER, STORE_OWNER_EMAIL_ADDRESS) . "\n\n"; // include copyright $email_order .= "\n-----\n" . EMAIL_FOOTER_COPYRIGHT . "\n\n"; */
Bookmarks