What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

draftOrderInvoiceSend email->body does not reflect on the sent email

draftOrderInvoiceSend email->body does not reflect on the sent email

fazlul_kabir
Shopify Partner
7 0 0

We wanted to send customized invoices against draft orders. That's why we tried draftOrderInvoiceSend mutation.
According to the documentation, the draftOrderInvoiceSend mutation does accept an email body. But the provided body doesn't reflect on the actual email that is sent! Although the email->customMessage does work! It even supports HTML.

 

I've tried passing simple HTML, LIquid(exact one from '/email_templates/draft_order_invoice/preview' and modified one) to the email body. None of them works! It always sends the default email. 


Here's my sample passed variables:

{
  "email": {
    "customMessage": "This works, even html!",
    "body": "This does not work, whatever I pass. Liquid or Html none of them works",
    "from": "store_admin_emial",
    "subject": "Email Body test",
    "to": "customer_emial"
  },
  "id": "draft_order_gid"
}


I couldn't find any restrictions stated in the Doc. If anyone has got any idea please help me out. 

Replies 5 (5)

SBD_
Shopify Staff
1831 273 421

Hey @fazlul_kabir 

 

Thanks for reporting this. I'm able to replicate. I've checked in with the team who maintain this feature and they've said that field is there by mistake and will be removed shortly.

Scott | Developer Advocate @ Shopify 

fazlul_kabir
Shopify Partner
7 0 0

Thanks for checking. I understand that the field wasn't expected to be there.
So, is there any other way we can send a customized Invoice to customers?

SBD_
Shopify Staff
1831 273 421

Unfortunately not via the API. Right now the only way to customize the email is through Admin > Notifications.

Scott | Developer Advocate @ Shopify 

dahenn
Shopify Partner
3 0 4

Any update on this issue? I'm trying to use the draftOrderInvoiceSend mutation and none of the "email" custom inputs seem to work. The draft order invoice emails are getting sent successfully via graphql api but only with the default subject and custom messages despite different definitions in my request.

 

Edit: never mind! I figured out that I forgot to specify the email variables in the actual request!

aaroncc
Shopify Partner
3 0 1

Can you send over the Query and GraphQL Variables you used for the request?

I'm stuck.