Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Mar 2007
    Location
    Deep in the Black Country, UK
    Posts
    34
    Plugin Contributions
    0

    Default Order Status emails - different template for dispatched

    Hi

    This is probably going to sound muddled but what I am trying to do is add some delivery information to the dispatch/delivered email that is sent when you change the order status.

    I *think* this can be done quite simply by copying and altering the order status email template, then specifying the template should be used when the status is updated to dispatched.

    I *think* this needs an 'if' and 'else' putting into admin/orders.php around line 121 but php isnt my strong point.

    I also thought it might be possible to pre-fill the message box with the information when dispatched is selected as a status update but no real idea how to begin with that.

    Can anybody give me a little direction, either with the 'if' and 'else' or how to go about pre-filling the message field when the status update is selected?

    Thankyou very much!
    Claire

  2. #2
    Join Date
    Mar 2007
    Location
    Deep in the Black Country, UK
    Posts
    34
    Plugin Contributions
    0

    Default Re: Order Status emails - different template for dispatched

    .. on the other hand lines 98-100 look more promising..

    Code:
    if (isset($_POST['notify_comments']) && ($_POST['notify_comments'] == 'on') && zen_not_null($comments)) {
                  $notify_comments = EMAIL_TEXT_COMMENTS_UPDATE . $comments . "\n\n";
                }
    It could maybe preset the comments 'if' status is set to dispatched?


  3. #3
    Join Date
    Mar 2007
    Location
    Deep in the Black Country, UK
    Posts
    34
    Plugin Contributions
    0

    Default Re: Order Status emails - different template for dispatched

    Cracked it!

    Info for anybody wanting to do the same, I altered after line 103 of admin/orders.php where it says // send emails.

    It now looks like this

    Code:
    if ($status == '3') {
          $message = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" .
          EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n\n" .
          EMAIL_TEXT_INVOICE_URL . ' ' . zen_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n\n" .
          EMAIL_TEXT_DATE_ORDERED . ' ' . zen_date_long($check_status->fields['date_purchased']) . "\n\n" .
          EMAIL_TEXT_STATUS_UPDATED . sprintf(EMAIL_TEXT_STATUS_LABEL, $orders_status_array[$status] ) . "\n\n" .
          strip_tags($notify_comments) . 
          strip_tags(EMAIL_TEXT_DELIVERY_INFORMATION) . "\n\n" .
          EMAIL_TEXT_STATUS_PLEASE_REPLY;
      } else {
    	  $message = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" .
          EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n\n" .
          EMAIL_TEXT_INVOICE_URL . ' ' . zen_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n\n" .
          EMAIL_TEXT_DATE_ORDERED . ' ' . zen_date_long($check_status->fields['date_purchased']) . "\n\n" .
          EMAIL_TEXT_STATUS_UPDATED . sprintf(EMAIL_TEXT_STATUS_LABEL, $orders_status_array[$status] ) . "\n\n" .
          strip_tags($notify_comments) . "\n\n" .
          EMAIL_TEXT_STATUS_PLEASE_REPLY;
      }
    
    
          $html_msg['EMAIL_CUSTOMERS_NAME']    = $check_status->fields['customers_name'];
          $html_msg['EMAIL_TEXT_ORDER_NUMBER'] = EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID;
          $html_msg['EMAIL_TEXT_INVOICE_URL']  = '<a href="' . zen_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') .'">'.str_replace(':','',EMAIL_TEXT_INVOICE_URL).'</a>';
          $html_msg['EMAIL_TEXT_DATE_ORDERED'] = EMAIL_TEXT_DATE_ORDERED . ' ' . zen_date_long($check_status->fields['date_purchased']);
          $html_msg['EMAIL_TEXT_STATUS_UPDATED'] = str_replace('\n','', EMAIL_TEXT_STATUS_UPDATED);
          $html_msg['EMAIL_TEXT_STATUS_LABEL'] = str_replace('\n','', sprintf(EMAIL_TEXT_STATUS_LABEL, $orders_status_array[$status] ));
          $html_msg['EMAIL_TEXT_NEW_STATUS'] = $orders_status_array[$status];
    //      $html_msg['EMAIL_TEXT_STATUS_COMMENTS'] = nl2br($notify_comments);
    // <---- Start Edit ---->
          if ($status == '3') {
    	      $html_msg['EMAIL_TEXT_STATUS_COMMENTS'] = nl2br($notify_comments) . nl2br(EMAIL_TEXT_DELIVERY_INFORMATION);
          } else {
    	      $html_msg['EMAIL_TEXT_STATUS_COMMENTS'] = nl2br($notify_comments);
          }
    // <---- End Edit ---->
          $html_msg['EMAIL_TEXT_STATUS_PLEASE_REPLY'] = str_replace('\n','', EMAIL_TEXT_STATUS_PLEASE_REPLY);
    Also added a line into admin/languages/english/orders.php

    Code:
    define('EMAIL_TEXT_DELIVERY_INFORMATION', 'Delivery Info Goes Here');
    Ive moved the comments to below the order status in the email updates, the text is done above and the html by altering email/email_template_order_status.html to suit.

    Hope its useful to somebody! There is probably a better way to do it I didnt find but feeling good about it myself, will update the live site tomorrow

  4. #4
    Join Date
    Oct 2007
    Posts
    157
    Plugin Contributions
    0

    Default Re: Order Status emails - different template for dispatched

    Quote Originally Posted by ceegeeaar View Post
    Cracked it!
    Hope its useful to somebody! There is probably a better way to do it I didnt find but feeling good about it myself, will update the live site tomorrow
    Thank you! I had been looking every where and couldn't figure out how to do it. I was wanting to make it easier for people who downloaded a product to be able to understand when the download was ready and what to do. I was able to tailor what you did for this.

    Thanks so much!

  5. #5
    Join Date
    Mar 2008
    Posts
    39
    Plugin Contributions
    0

    Default Re: Order Status emails - different template for dispatched

    I couldn't get this to work.

    It kept the default text used on every order status changes.

    The only one I want to change is the text sent by when you use delivered.

    Any ideas?

 

 

Similar Threads

  1. Status should be Dispatched. Not Delivered?
    By I wish I could in forum Installing on a Linux/Unix Server
    Replies: 3
    Last Post: 3 Apr 2015, 04:39 AM
  2. v150 Can I add different emails based on status?
    By n_t_r in forum Managing Customers and Orders
    Replies: 2
    Last Post: 31 May 2013, 02:38 PM

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