Re: Notifying customer when their order is edited

Solved

Notifying customer when their order is edited

evris_k
Visitor
3 0 3

Good day,

I use a private app to update orders using the GraphQL Admin API. When I commit the edited order using https://shopify.dev/docs/admin-api/graphql/reference/mutation/ordereditcommit?api[version]=2020-04 I set the notifyCustomer argument as true but the customer does not receive a notification email. What might be the problem and are there any workarounds?

Accepted Solution (1)
_JB
Shopify Staff (Retired)
836 100 223

This is an accepted solution.

Hey @evris_k @Gregarican,

I just tested this myself but everything worked as expected. Editing an order to remove or add quantity sent an e-mail as expected:

20-08-46sxg-ovkmb

The api_client I'm using has full access to the store, can you confirm if your apps have customer access?

As well, kindly provide the ids of the orders you edited in your tests and I'll use that to investigate further.

JB | Solutions Engineer @ Shopify 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Replies 6 (6)

Gregarican
Shopify Partner
1033 86 292

I too went through a test case and never received any e-mail notification after this commit completed successfully. I added a dummy custom item to the order and committed it. Saw the transaction in the web admin order timeline, with the added order item along with a test note. But no e-mail was triggered. Perhaps someone from Shopify's team can chime in? 

_JB
Shopify Staff (Retired)
836 100 223

This is an accepted solution.

Hey @evris_k @Gregarican,

I just tested this myself but everything worked as expected. Editing an order to remove or add quantity sent an e-mail as expected:

20-08-46sxg-ovkmb

The api_client I'm using has full access to the store, can you confirm if your apps have customer access?

As well, kindly provide the ids of the orders you edited in your tests and I'll use that to investigate further.

JB | Solutions Engineer @ Shopify 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Gregarican
Shopify Partner
1033 86 292

@_JB actually I was doing this through the GraphQL app tool within the web admin. And looking at it, it has any/all permissions. 

_JB
Shopify Staff (Retired)
836 100 223

@Gregarican,

Do you mind providing an order_id from your test?

JB | Solutions Engineer @ Shopify 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Gregarican
Shopify Partner
1033 86 292

It worked when I just tried again. I originally hadn't defined the notify flag in the correct place. This fired off the e-mail notification as expected. All good!

 

mutation orderEditCommit($id: ID!) {
  orderEditCommit(id: $id, notifyCustomer: true) {
    order {
      id      
    }
    userErrors {
      field
      message
    }
  }
}

 

nitin19947
Visitor
1 0 0

@_JB   

I create an order using Order API and then added a custom item using mutation but the email for updated payment was not received for this case.

order_id - 3758918402245

To add a custom item.

 

query = '''mutation addCustomItemToOrder {
orderEditAddCustomItem(id: "gid://shopify/CalculatedOrder/12852822213", title: "Custom Line Item", quantity: 1, price: {amount: 40.00, currencyCode: USD}) {
calculatedOrder {
id
addedLineItems(first: 5) {
edges {
node {
id
}
}
}
}
userErrors {
field
message
}
}
}'''

 

 

 

To commit order.

 

query = '''mutation commitEdit {
orderEditCommit(id: "gid://shopify/CalculatedOrder/12852822213", notifyCustomer: true, staffNote: "Order Edited Using CRM") {
order {
id
}
userErrors {
field
message
}
}
}'''

 

 

Please check as I am not receiving any email Payment need to update in this case.