Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Add message integration to provide a tracking notification message type as well as default message type, view, rule event, etc.
Comment | File | Size | Author |
---|---|---|---|
#8 | message_integration-2574299-8.patch | 21.39 KB | nvahalik |
Comments
Comment #2
nvahalik CreditAttribution: nvahalik at Centarro commentedComment #3
nvahalik CreditAttribution: nvahalik at Centarro commentedUpdated the rule to have the proper condition. It checks for the commerce_shipments field and fires only if it has changed.
Comment #4
michfuer CreditAttribution: michfuer at Centarro commentedThe default message type looks good. The Rule to send the message should trigger when a shipment has been shipped, e.g. if shipment_status == shipped AND shipment_previous_status != shipped, send notification.
Also I'm not sure what value the View brings? It seems like something a competent site builder could construct in a short period of time.
Comment #5
nvahalik CreditAttribution: nvahalik at Centarro commentedI agree with you on the rule. The message rule should trigger if a shipment has been added and it has a tracking number OR if a tracking number on a shipment has changed. The tracking number being added is easy but something different will be required for the updated tracking numbers. There are no revision numbers and no internal state that appears to change when a shipment is changed. The order gets a new revision but is there a way to tell if the shipment tracking number has been updated from the commerce_order update hook?
Also, I'm not sure what you mean about the view... it's required for the token to render tracking numbers.
Comment #6
michfuer CreditAttribution: michfuer at Centarro commentedI didn't realize that about the View. My bad Nick. I still think leaving the View out will give the merchant more flexibility since they might want to config/style the line items separately from the tracking number.
In regards to the Rule it would be simpler to have a checkbox on the shipment edit form saying "Send shipment notification to order owner". This way it's explicit when the merchant is going to send a notification, and they don't need to learn about the underlying logic.
Comment #7
nvahalik CreditAttribution: nvahalik at Centarro commentedThe view has to stay in otherwise the default notification message won't work. If someone doesn't like the view they can still override it just like they can with any other view that gets provided by default.
Will get back with a patch for the proper notifications.
Comment #8
nvahalik CreditAttribution: nvahalik at Centarro commentedAttached patch adds a new rules event to trigger the sending of the email. It does this by manually checking the IEF field to see if it gets added. The rule is also update to use the new event which is defined the rules.inc file.
Comment #9
nvahalik CreditAttribution: nvahalik at Centarro commentedI'm moving this over to a sandbox for further development: Commerce Shipment Message Integration