Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Jul 2012
    Posts
    33
    Plugin Contributions
    0

    Default Order Confirmation Emails Question

    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.

  2. #2
    Join Date
    Jun 2005
    Location
    Hertfordshire, UK
    Posts
    9,922
    Plugin Contributions
    3

    Default Re: Order Confirmation Emails Question

    Quote Originally Posted by jimweinberg View Post
    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.
    Yes...

    All email settings are controlled in ADMIN >>> CONFIGURATION >>> EMAIL SETTINGS#

    Follow the examples given of how to set up multiple recipients.
    Did my post help you fix something? You can show your gratitude by buying the the dev team coffee.

  3. #3
    Join Date
    Jul 2012
    Posts
    33
    Plugin Contributions
    0

    Default Re: Order Confirmation Emails Question

    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.

  4. #4
    Join Date
    Jan 2004
    Posts
    58,464
    Blog Entries
    3
    Plugin Contributions
    111

    Default Re: Order Confirmation Emails Question

    Quote Originally Posted by jimweinberg View Post
    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?
    The default Zen Cart code takes the same email that was sent to the customer, adds an office-use-only section to it, and sends that to the storeowner.
    But you can of course rewrite the code to do whatever you like.
    .

    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.

  5. #5
    Join Date
    Jul 2012
    Posts
    33
    Plugin Contributions
    0

    Default Re: Order Confirmation Emails Question

    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.

  6. #6
    Join Date
    Jan 2004
    Posts
    58,464
    Blog Entries
    3
    Plugin Contributions
    111

    Default Re: Order Confirmation Emails Question

    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.

  7. #7
    Join Date
    Jul 2012
    Posts
    33
    Plugin Contributions
    0

    Default Re: Order Confirmation Emails Question

    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.

  8. #8
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    1,979
    Plugin Contributions
    21

    Default Re: Order Confirmation Emails Question

    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.

  9. #9
    Join Date
    Jul 2012
    Posts
    33
    Plugin Contributions
    0

    Default Re: Order Confirmation Emails Question

    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:
    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.
    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:
    /*    // 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, '&nbsp;')) $email_order = str_replace('&nbsp;', ' ', $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');
      }
    The resulting email section now 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 
    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.
    You'll notice that the copyright statement is gone, but the other 2 are still there. Any idea where/how they're being generated?

    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.

  10. #10
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    1,979
    Plugin Contributions
    21

    Default Re: Order Confirmation Emails Question

    I think I remember seeing some "issues" with bracketing comments around line comments; try this instead:
    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";
    */
    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.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Help: Not receiving [NEW ORDER] Order Confirmation Emails!
    By RocketFoot in forum General Questions
    Replies: 1
    Last Post: 15 Feb 2011, 05:55 PM
  2. Order Confirmation Emails
    By Dewster in forum Managing Customers and Orders
    Replies: 2
    Last Post: 5 Jun 2008, 11:01 PM
  3. Order Confirmation Emails
    By customilluminations in forum General Questions
    Replies: 1
    Last Post: 21 May 2007, 07:37 PM
  4. Order confirmation emails
    By Nellie in forum Managing Customers and Orders
    Replies: 3
    Last Post: 5 Jan 2007, 05:46 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •