Order API - Confirmation Email

jtharris-dev
New Member
3 0 0

Is there a way to determine if a confirmation email has been sent, and if not, send the order confirmation? We are using an app which creates draft orders. Unfortunately some of the confirmation emails are not being sent. Shopify is working with the app developer to help correct the issue, but in the meantime, I would love to build a process that looks to see if an order confirmation has not been sent, and if not, send the order confirmation. I don't see anything in the Order API that would allow me to see if an order confirmation has been sent, nor do I see anything that would allow me to send an order confirmation, but I may have missed it... Is this possible via API? Thanks!

Reply 1 (1)
L_J_K
Shopify Staff
Shopify Staff
400 64 81

Hey @jtharris-dev 

Thanks for getting in touch! In REST API There's the boolean send_receipt that can be specified in the body of the request when creating an order. If set true, an order confirmation will be sent to the customer (send_receipt docs). You may wish to check out notify_customer on the fulfillments endpoint too in REST(docs). Yet I don't see a way to Read these values in REST for what it's worth and I don't see them present in the corresponding orders/create and fulfillment/create hooks.

That said, CanNotifyCustomer is present on Order object in the GQL Admin API here and it can be read. 

You may wish to use REST Admin API to set the send_receipt value and use the GraphQL Admin API to read via CanNotifyCustomer as testing this today,  when setting send_receipt === true in REST, it means  CanNotifyCustomer === true in GraphQL. Hope that helps!

| Shopify |
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!