|
Hello, Creating a shipment programmaticallyWhen I programmatically create a shipment to fulfill an order via my backend, no email is sent to warn the end user the order is shipped unless i specify a '$notify' parameter in my shipment payload. This is not documented but i found this parameter by inspecting what the swell dashboard was doing via Dev Tools. Without that option, no email is sent. Here is my code, Note the "$notify" in the last line. Creating a shipment via the swell dashboard UI :In the create/edit shipment (FULFILLMENT) popup from the order management (above screenshot), you can see that there is a 'Send email confirmation to customer' checkbox. I understood from this checkbox, that sending an email was an option. This is checked by default when creating a shipment via the UI and unchecked by default when updating a shipment via the UI. Hence, my question is :
Note 1 : I was not able to find any relevant documentation in the shipment section here. There is this "notifications" key in the shipment model but it seems to be a read only value when getting shipments. Note 2 : I also noticed that when we're dealing with a shipment update, the $notify value was 'orders.shipped-update' and not 'orders.shipped' anymore (seems logical). |
Replies: 1 comment
|
Hi @brahima , you're exactly right: to send a notification when creating a shipment programmatically, you can include I agree this would be great to have documented and have reached out to our content writing team to include in the docs. Thanks for your detailed comment! |

Hi @brahima , you're exactly right: to send a notification when creating a shipment programmatically, you can include
"$notify": "orders.shipped"in the request payload.I agree this would be great to have documented and have reached out to our content writing team to include in the docs. Thanks for your detailed comment!