Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2009
    Posts
    4
    Plugin Contributions
    0

    help question Email after updating status

    Hello, I'm new to ZenCart. I'm actually a data-person working for a company that has implemented ZenCart and is very happy with it. My task is to get all of those customers and orders entered in ZenCart over to the ERP system -- that's going fine -- and then write updates back to the Zen DB when an order is shipped. Looks like zen_orders_status_history is the place for that.

    When they update an order in the ZenCart GUI, an email is automatically sent to the customer with the text that is in that status_history table.

    But I'm trying to take away those manual entries. Is there any way I can hook in to the procedures that send those emails without someone having to "touch" the order? I know I could write my own email-the-customer-when-there's-a-new-status-history-record procedure, but they are very happy with how Zen handles it. Is there any way to do that?

    Thanks!

  2. #2
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Email after updating status

    Right now the only way is to use the Zen Cart UI.

    You could adapt the code to perhaps load a CSV you export from your ERP system, or poll your ERP system for applicable updates using a live API call ... and then maybe add a link to your admin area that triggers that part of the code so that it does the polling and sending of all the email updates for you ... and just remember to go click the link once a day, or whatever frequency you desire.
    .

    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
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: Email after updating status

    Are you doing the update directly into the database? Via a SQL query, for example?

    If so, you are thus bypassing the php that is "activated" when the update status is changed in zencart admin - and part of that php is to generate the email (if the option to senc such a message is selected).
    20 years a Zencart User

  4. #4
    Join Date
    Nov 2009
    Posts
    4
    Plugin Contributions
    0

    Default Re: Email after updating status

    Thank you for the replies! I thought it was likely buried in the php somewhere. Yes, I will be doing the updates via sql query, assuming there is no reason NOT to do that (zen looks like a very simple DB, and I mean that in a GOOD way!).

    It looks like this:

    ERP system is on MSSQL. I've set up MySQL as a linked server.

    1. Scheduler goes and looks for new customers, imports them to the MSSQL-based ERP using a stored procedure

    2. Scheduler looks for new orders, imports them to the SQL ERP

    3. Scheduler checks for new open orders in ERP from Zen, and will run a procedure to update the order and the order status history

    4. Scheduler checks for shipments of orders that were imported from Zen, and updates the orders_status_history so that when customers log into their account, they'll see the shipment message and tracking number

    5. Scheduler sends an email to the customer with that info (since I can't cleanly hook into that php code).

    I just had to verify there wasn't some good way to use the existing code for that, since these folks are so happy with Zen! Before I push back and say, seriously, let the scheduler send the email (it does that just fine), I had to be sure I wasn't missing something.

    Thanks again for the replies. If you see anything glaringly wrong with the above scenario, please let me know.

    Thanks!!

  5. #5
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Email after updating status

    If you've already got your Scheduler doing that, I'd say stick with it. If you need to reformat the email it's sending to match the appearance of what Zen Cart sends, maybe that's the best way to spend your time.
    .

    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.

 

 

Similar Threads

  1. v154 DONT send emails after updating order status
    By jeffiec in forum General Questions
    Replies: 5
    Last Post: 6 Apr 2015, 11:41 PM
  2. Blank page after updating an order status
    By tundria in forum General Questions
    Replies: 3
    Last Post: 3 Mar 2012, 04:34 PM
  3. Email to customer after Order status update
    By awk_grep in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 13 Mar 2007, 07:13 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