Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 47
  1. #21
    Join Date
    Oct 2012
    Posts
    4
    Plugin Contributions
    0

    Default Re: email order confirmation to third party

    I need something similar and I'm having a hard time figuring it out. The website is for a medical office that sells nutritional supplements. They have a referral program, and the customer chooses the referring provider from a drop-down during the sign-up process. The client wants an order confirmation email to also go to the referring provider upon checkout. Any ideas on how to do this?

    Thank you in advance for your time.

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

    Default Re: email order confirmation to third party

    Change the SQL query to retrieve the appropriate destination email address, instead of doing customer-group lookup.
    .

    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. #23
    Join Date
    Oct 2012
    Posts
    4
    Plugin Contributions
    0

    Default Re: email order confirmation to third party

    Quote Originally Posted by DrByte View Post
    Change the SQL query to retrieve the appropriate destination email address, instead of doing customer-group lookup.
    Am I going in the right direction?

    PHP Code:
    <?php
    /**
     * observer class to send custom extra order emails to referring clinic/doctor
     *
     * @package classes
     * @copyright Copyright 2003-2010 Zen Cart Development Team
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: class.sendReferralOrderNotices.php  2010-05-26 20:05:22Z drbyte $
     */
    class sendReferralOrderNotices extends base {

     
    /**  constructor method !
       *
       * Attach observer class to the global $zco_notifier and watch for a single notifier event.
       */
      
    function sendReferralOrderNotices() {
        
    $this->attach($this, array('NOTIFY_ORDER_AFTER_SEND_ORDER_EMAIL'));

        
    /**
         * Set the email subject line for the messages being sent to the external supplier
         * Use EMAIL_TEXT_SUBJECT for the default subject, or replace with 'My Custom Subject Line' instead.
         */
        
    $this->orderEmailSubjectPrefix 'Order Fulfillment Request from ' STORE_NAME;
      }


     
    /**   Actual Method that does the desired activity
       *
       * Called by observed class when any of the notifiable events occur
       *
       * @param object $class
       * @param string $eventID
       */
      
    function update(&$class$eventID$paramsArray = array()) {
        global 
    $db;
        list(
    $zf_insert_id$email_order$extra_info$html_msg) = $paramsArray;

        
    //$group_query = $db->Execute("select customers_group_pricing from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");

        
    $referral_query $db->Execute("SELECT sources.sources_email AS sources_email
                                        FROM sources INNER JOIN customers ON sources.sources_id = customers.customers_info_source_id
                                        WHERE customers.customers_id = '" 
    . (int)$_SESSION['customer_id'] . "'");

        
    //if (!$referral_query->EOF && $referral_query->fields['customers_group_pricing'] == $this->specialReferralId) {
        
        
    if (!$referral_query->EOF) {
        
              
    $this->specialReferralEmailAddress $referral_query->fields['sources_email'];

              
    zen_mail(''$this->specialReferralEmailAddress,
              
    $this->orderEmailSubjectPrefix EMAIL_ORDER_NUMBER_SUBJECT $zf_insert_id,
              
    $email_order $extra_info['TEXT'], STORE_NAMEEMAIL_FROM$html_msg'checkout_extra'$this->attachArray);
        }
      }
    }

    Sorry I'm relatively new to zen cart. Thank you for your help.

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

    Default Re: email order confirmation to third party

    Looks good, assuming the SQL query pulls back the right data.
    .

    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. #25
    Join Date
    Oct 2012
    Posts
    4
    Plugin Contributions
    0

    Default Re: email order confirmation to third party

    Quote Originally Posted by DrByte View Post
    Looks good, assuming the SQL query pulls back the right data.
    Do you know of any reason this wouldn't work with v1.3.8? I can't get it to send an email even when I hard code the recipient email address in the zen_mail function in the class file. Upgrading is not an option at this time.

    This was the only difference in order.php:
    PHP Code:
        //$zco_notifier->notify('NOTIFY_ORDER_AFTER_SEND_ORDER_EMAIL');

        
    $zco_notifier->notify('NOTIFY_ORDER_AFTER_SEND_ORDER_EMAIL', array($zf_insert_id$email_order$extra_info$html_msg)); 

  6. #26
    Join Date
    Jul 2012
    Posts
    99
    Plugin Contributions
    0

    Default Re: email order confirmation to third party

    Is this will work with 1.5.1?

    I need to add something really similar to specific products. Maybe as an attribute...? The store will sell many products but one of them is a membership card that will need an approbation from clubs who are affiliated with the store. So on these specific products the customer should have to select his club in the buying process. Each club needs to be associated with an email adress wich will be used to send a copy of the email order confirmation. Then the club will have to reply to confirm that the customer is a member. Not sure how to implement this...

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

    Default Re: email order confirmation to third party

    Yes, you could rework all the code to focus on purchased attributes of specific products instead of customer-groups.

    So, instead of testing whether the shopper is a member of a specific customer-group, test whether the $order->products array contains specific products, and whether the attributes sub-array contains the specific attribute you want to notify about. And then based on which attribute, send an email to the correspondingly appropriate email address.
    .

    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. #28
    Join Date
    Jul 2012
    Posts
    99
    Plugin Contributions
    0

    Default Re: email order confirmation to third party

    I see. Seems a hard work to "rework all the code" but should be doable. Thanks for the input, I'll try to figure it out.

  9. #29
    Join Date
    Jul 2012
    Posts
    99
    Plugin Contributions
    0

    Default Re: email order confirmation to third party

    I installed it and it's working like a charm, the way it's suppose to work. Beautiful job Dr! But I tested it before I make any modification and I realized that it unfortunately do not really do what I need...

    I made the attributes with all the clubs in a dropdow list than, by testing the attribute as a customer I understood that the selected option really needs to be linked to the customer and should be relative to him instead of a product. I could add this drop down menu to the inscription page but it's only needed if the customer want to buy something in a specific product category member cards). To be a member of one of the affiliated clubs is an absolute prerequisite to buy a member card but for all other item the customer do not need it at all... Every year the customer will be able to renew his membership card with the info in his account.

    And as explained, when the customer buy the member card, the selected club needs to be contacted for a confirmation that this customer is really one of its member. In a perfect world the club representant who will receive the confirmation request could just follow a link in the email that would bring him on a page where he'll be able to gives his confirmation by clicking on a button, then the order status would pass to the approved status and the customer + administration would receive the update email. That would be so nice!

    Do you have an idea on how implement that?
    Last edited by AlexThibo; 28 Sep 2013 at 06:10 PM.

  10. #30
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: email order confirmation to third party

    I'm glad you were able to use the code examples above to make things work as you initially described.

    But your last question describes a situation that is a LOT more complex than the subject of this discussion thread. Your specialized needs should be discussed in a new thread: You need more than just email-confirmation-to-third-party ... I suspect you really need real-time verification of membership status from those 3rd-party sites *before* allowing the purchase to happen on *your* site.
    .

    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.

 

 
Page 3 of 5 FirstFirst 12345 LastLast

Similar Threads

  1. v153 When order is in "Processing" status send email to third party
    By jdlauletta in forum General Questions
    Replies: 0
    Last Post: 6 Nov 2014, 08:07 PM
  2. v150 Order confirmation to third party email - PROBLEM
    By MelodyW in forum Managing Customers and Orders
    Replies: 3
    Last Post: 23 Apr 2013, 03:11 PM
  3. Third party templates
    By travellers in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 9 Jan 2009, 03:31 PM
  4. Third Party Gift Certificate
    By BazM in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 25 Nov 2008, 11:17 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR