Page 1 of 1

Shipping an order through code doesn't fire email trigger

Posted: Mon Jan 18, 2010 11:31 am
by AbleMods
I've got a project where I've automated shipment postings through code.

As a result, the code manages the shipment record just like the Able code does including a call to _OrderShipment.Ship(); at the end.

However the client is reporting my shipment code works flawlessly but the order-shipment email never fires. Manually shipping an order does fire the email off, but not if my code ships the order.

The order status goes to shipped as it should. The shipment record and tracking records are setup like they should. Any thoughts on what would cause this scenario?

Re: Shipping an order through code doesn't fire email trigger

Posted: Tue Jan 19, 2010 8:18 am
by mazhar
Its a wild guess that have a look on your shipment data and make sure that this information shipment.Order, shipment.Order.User and shipment.Order.Payments is populated as it should. If system is triggering Email on manual shipment then it sounds like in custom code you are missing something that is required.

Re: Shipping an order through code doesn't fire email trigger

Posted: Tue Jan 19, 2010 10:09 am
by AbleMods
Thanks Mazhar. I agree.

I dug through the code a couple of times, comparing directly to the AC7 ship code. It's not on my end.

Customer later responded their triggers weren't working right. So for now everyone is presuming it's an issue in their setup and not my code.

Automatic processing of shipments and tracking info was tricky - figuring out how to determine which items shipped versus which should be moved to a new shipment record was surprisingly complex.