0

Working on a project where there is a need to be able to take data provided in the form of an xml file, from an AS400 mainframe, which updates information relating to certain orders placed in Expresso.

Notably, a status change from 'approved' to 'shipping'. Naturally, when this occurs the customer should be notified via email along with a provided shipping number.

The issue at hand is how to trigger an email within Expresso when a simple database change on a field is made. If one goes through the application itself, via the GUI, and changes a status then an email is sent. However, the staff want no part in manually changing order statuses on the EE end of things. They'd rather only have to focus on the AS400.

So there has to be logic in place to accomplish this.

The Expresso team was helpful and pointed me in the right direction, however I was hoping for some additional clarity from you guys and perhaps recommendations or code examples.

Anything that triggers our updateStatus method in Order.php will trigger any emails and actions associated with the change of order status. So if you have emails setup to be sent for each status then these will be triggered.

If you're changing the status outside of the Store application however and not going through our updateStatus method then you'll need to latch on to our Order Status hooks (https://exp-resso.com/docs/extension_hooks.html#order_status_hooks). You can use the store_order_update_status_end to fire off an email or anything else you need to perform once the status has been changed.

This is my first time diving this deep into EE or Expresso. I've done some exciting things so far in this project, but this one has been the most indepth thus far.

  • I'm not familiar with your mainframe system, but do you have the ability to call a PHP script when you want to update the order status, rather than editing the database directly? – Adrian Macneil Apr 15 '14 at 11:18
  • Oh don't get me wrong, I know nothing about the AS400 or Mainframes either. Relating to your question specifically, the issue is that they send us an XML file in order to update certain orders. This is picked up by Datagrabber (EE plugin) and ported into the requisite channels, which are in the database. I wouldn't really know how to piggyback a PHP script on that process. – Mike Apr 15 '14 at 12:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.