Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2006
    Posts
    22
    Plugin Contributions
    0

    Default Send different email depending on order status

    I need help configuring my cart to send a slightly different email depending on order status.
    I am using zencart to sell event tickets.
    When a customer orders a ticket they are sent the order confirmation email which includes the "order number". This is set in: includes/languages/english/your_template/checkout_process.php. line 27

    I have set up the cart so that when I update the order to delivered, it sends the order update email but instead of showing "order number", it shows "ticket reference number". This is set in:
    admin/includes/languages/english/orders.php. line 76

    My problem with this is that admin/includes/languages/english/orders.php deals with all update types and if someone pays by check or money order I want to update the order to processing, and for the email to show "order number" but when I do, it sends the update email which shows "ticket reference number" not "order number".

    How can I change the "processing" update email to show "order number" and leave the "delivered" update email to show "ticket reference number"?

  2. #2
    Join Date
    Sep 2008
    Posts
    30
    Plugin Contributions
    0

    Default different confirmation texts, depending on order status

    I would like to add different texts in the confirmation mails, depending on the status of the order.

    (1) the first question is how to add text to a confirmation mail. Should I try to edit the order.php or is there a more easy way?

    (2) can I send different texts? To put it in other words: can I add different texts to the emails that are send when the order status is updated?
    I don't mean the comments I can send with them. I would like it to be a standard, automatic, text for every status.

    Would this be possible and if so, how can I accomplish this?

    thanks!

  3. #3
    Join Date
    Sep 2008
    Posts
    30
    Plugin Contributions
    0

    Default Re: different confirmation texts, depending on order status

    Took a while, but finally found it. For those who also want to do this:

    In (a copy of) admn/orders.php I added the following code, just after the //send emails comment. It's dutch, but you'll get the idea...

    No garantees whatsoever: I'm a beginner.

    Code:
     //send emails
    if ($orders_status_array[$status]=="besteld"){	
     define('EMAIL_TEXT_ANJO1', ''); 
     define('EMAIL_TEXT_ANJO2', 'Wacht svp met betalen tot uw order de status -bevestigd- heeft. De status van de bestelling staat hieronder aangegeven.'); 
    }
    elseif ($orders_status_array[$status]=="bevestigd")	{
     define('EMAIL_TEXT_ANJO1', 'Het totaal van uw bestelling kunt U vinden in de eerste mail of op de site (zie de verwijzing naar de gedetailleerde factuur verderop in deze mail). U kunt het geld voor uw bestelling overmaken op giro 375.18.75 (3751875) t.n.v. J. Smits Utrecht, onder vermelding van het bestelnummer dat hierboven staat. Zodra de betaling (’s avonds) zichtbaar is verzend ik het zo snel mogelijk. Dat is meestal binnen 1-2 werkdagen (in het weekeinde of met schoolvakanties kan het dus wat langer duren).');
     define('EMAIL_TEXT_ANJO2', 'Als u nog voorkeur heeft voor de frankering van uw bestelling kunt u kiezen uit de zegels die ik voor porto gebruik. Deze zijn te vinden op www.anjozegels.nl/index.php?main_page=anjofrankeerz .');
    }
    elseif ($orders_status_array[$status]=="verzonden")	{
     define('EMAIL_TEXT_ANJO1', 'Het geld staat er inmiddels op en het gaat zo snel mogelijk op de bus. Veel plezier ermee!'); 
     define('EMAIL_TEXT_ANJO2', 'Mocht een zegel een mankement vertonen dat niet in de advertentie of op de afbeelding beschreven staat of zichtbaar is dan mail me maar even, dan kunnen we proberen dat op te lossen. Alhoewel ik zorgvuldig probeer te werken, kan ik natuurlijk altijd iets over het hoofd zien.'); 
    }
    else {
     define('EMAIL_TEXT_ANJO1', ''); 
     define('EMAIL_TEXT_ANJO2', ''); 
    }
     define('EMAIL_TEXT_ANJO3', 'met vriendelijke groeten, Anjo'); 
    
              $message = STORE_NAME . "\n" . 
              EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_SEPARATOR . "\n\n" .
              strip_tags($notify_comments) . 
    "\nDag!\n\n" . 
    EMAIL_TEXT_ANJO1 . "\n\n" .
    EMAIL_TEXT_ANJO2 . "\n\n" .
    EMAIL_TEXT_ANJO3 . "\n\n" .
    EMAIL_SEPARATOR . "\n\n" .
    // anjo          EMAIL_TEXT_STATUS_UPDATED . sprintf(EMAIL_TEXT_STATUS_LABEL, $orders_status_array[$status] ) .
    EMAIL_TEXT_STATUS_UPDATED . sprintf($orders_status_array[$status] ) . "\n\n" .
              EMAIL_TEXT_DATE_ORDERED . ' ' . zen_date_long($check_status->fields['date_purchased']) . "\n\n" .
              EMAIL_TEXT_INVOICE_URL . ' ' . zen_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n\n" .
    EMAIL_SEPARATOR . "\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_COMMENTS'] = nl2br($notify_comments);
              $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];

 

 

Similar Threads

  1. Replies: 6
    Last Post: 17 Oct 2012, 04:01 AM
  2. Replies: 4
    Last Post: 13 Jun 2009, 10:30 PM
  3. change order status but do not want to send customer email
    By jrf in forum Managing Customers and Orders
    Replies: 6
    Last Post: 10 May 2009, 09:40 PM
  4. Send email order to Different suppliers ???
    By smndvy in forum General Questions
    Replies: 1
    Last Post: 12 Dec 2008, 07:01 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