Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    red flag Order Email Templates

    Not sure if this fits in here, however I need to know if its possible for the customer to receive a different html format email to the admins html formatted email?
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Order Email Templates

    It would require some customization ... but can you be more specific about why? and "how" different?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    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.

  3. #3
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    Default Re: Order Email Templates

    Thats what I thought. The HTML Emails the customer receives at the moment contain banners with links to social media and offers etc. If I enable HTML emails for the admin they get the same format with the banners and offers, however, my client doesn't want these on the emails he gets, he only wants banners on the emails the customer gets. BUT, he does want to display his logo on the emails he receives and does want to retain the format the customer gets, just without the banners. The reason he doesn't want to receive the same email as the customer is because when an order comes through by email, it automatically gets printed and if he gets the same email as the customer with the banners, it prints off three pages for each html format order email. This is obviously unnecessary and leads to waste paper and alot of wasted ink. He wants to keep the same format as the customer as he has people that do his packing who pick off the printout and have to be able to read it easily. We have already tried switching off the HTML format for the admin emails, but the problem with that, is that sometimes the details on the email get printed off bunched up, which leads to errors if his packing staff are in a rush to get things in the post e.g. They may read the email, but miss something because it is not clearly formatted.

    I hope that makes some sense?
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Order Email Templates

    /includes/classes/order.php
    At line 1091 (in v155), you'll see the following section. Add the line shown:
    Code:
          $html_msg['EXTRA_INFO'] = $extra_info['HTML'];
    
          $html_msg['EMAIL_TEMPLATE_FILENAME'] = DIR_FS_EMAIL_TEMPLATES . "email_template_admin_orders";
    
          // include authcode and transaction id in admin-copy of email
    Then go to the /email/ and clone the email_template_checkout.html file to a new file called email_template_admin_orders.html ... and remove the advertisements from that file.



    Ideally the better way would be to *not* touch the order.php file, but to instead create a small observer class which listens for 'NOTIFY_ORDER_INVOICE_CONTENT_FOR_ADDITIONAL_EMAILS' and puts that code change inside its update actions.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    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
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    Default Re: Order Email Templates

    Quote Originally Posted by DrByte View Post
    /includes/classes/order.php
    At line 1091 (in v155), you'll see the following section. Add the line shown:
    Code:
          $html_msg['EXTRA_INFO'] = $extra_info['HTML'];
    
          $html_msg['EMAIL_TEMPLATE_FILENAME'] = DIR_FS_EMAIL_TEMPLATES . "email_template_admin_orders";
    
          // include authcode and transaction id in admin-copy of email
    Then go to the /email/ and clone the email_template_checkout.html file to a new file called email_template_admin_orders.html ... and remove the advertisements from that file.



    Ideally the better way would be to *not* touch the order.php file, but to instead create a small observer class which listens for 'NOTIFY_ORDER_INVOICE_CONTENT_FOR_ADDITIONAL_EMAILS' and puts that code change inside its update actions.
    Ok well the order.php way seems easy enough.

    How would I do it with 'NOTIFY_ORDER_INVOICE_CONTENT_FOR_ADDITIONAL_EMAILS' then?
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  6. #6
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    Default Re: Order Email Templates

    How would I adjust this https://www.zen-cart.com/entry.php?4...Create-Account

    to create an observer for the order email then? Obviously the order.php way will do for now but I would like to do it properly.
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  7. #7
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Order Email Templates

    Quote Originally Posted by Nick1973 View Post
    How would I do it with 'NOTIFY_ORDER_INVOICE_CONTENT_FOR_ADDITIONAL_EMAILS' then?
    Requires v1.5.5 minimum

    Create a new file (filename matters, because "auto.admin_order_email_html_template.php" corresponds to "zcObserverAdminOrderEmailHtmlTemplate") :

    /includes/classes/observers/auto.admin_order_email_html_template.php

    Code:
    <?php
    /**
     * Specify alternate Admin HTML template for order emails
     * Observer class designed for v1.5.5
     */
    
    class zcObserverAdminOrderEmailHtmlTemplate extends base {
    
      function __construct() {
        $this->attach($this, array('NOTIFY_ORDER_INVOICE_CONTENT_FOR_ADDITIONAL_EMAILS'));
      }
    
      function updateNotifyOrderInvoiceContentForAdditionalEmails(&$class, $eventID, &$zf_insert_id, &$email_order, &$html_msg)
      {
        $html_msg['EMAIL_TEMPLATE_FILENAME'] = DIR_FS_EMAIL_TEMPLATES . "email_template_admin_orders";
      }
    }
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    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.

  8. #8
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    red flag Re: Order Email Templates

    Quote Originally Posted by DrByte View Post
    Requires v1.5.5 minimum

    Create a new file (filename matters, because "auto.admin_order_email_html_template.php" corresponds to "zcObserverAdminOrderEmailHtmlTemplate") :

    /includes/classes/observers/auto.admin_order_email_html_template.php

    Code:
    <?php
    /**
     * Specify alternate Admin HTML template for order emails
     * Observer class designed for v1.5.5
     */
    
    class zcObserverAdminOrderEmailHtmlTemplate extends base {
    
      function __construct() {
        $this->attach($this, array('NOTIFY_ORDER_INVOICE_CONTENT_FOR_ADDITIONAL_EMAILS'));
      }
    
      function updateNotifyOrderInvoiceContentForAdditionalEmails(&$class, $eventID, &$zf_insert_id, &$email_order, &$html_msg)
      {
        $html_msg['EMAIL_TEMPLATE_FILENAME'] = DIR_FS_EMAIL_TEMPLATES . "email_template_admin_orders";
      }
    }
    Ok well the cart is currently running 1.5.4 so the first task will obviously be to upgrade. Then I will give this a go. Thanks very much Dr Byte! :-)
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

 

 

Similar Threads

  1. v154 eMail Templates HTML vs Text and email defines
    By kwright in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 26 Feb 2015, 03:09 AM
  2. v151 Different email templates per order status. Is it possible?
    By strelitzia in forum Managing Customers and Orders
    Replies: 2
    Last Post: 17 Jul 2014, 11:06 AM
  3. Received order payment email but not order email
    By thebeveragegourmet in forum Addon Payment Modules
    Replies: 6
    Last Post: 12 Sep 2010, 07:43 PM
  4. Email templates
    By Jatt in forum Managing Customers and Orders
    Replies: 7
    Last Post: 12 Aug 2010, 06:35 PM
  5. override email templates in email folder
    By epol in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 27 Sep 2006, 08:47 AM

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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR