A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
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.
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
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?
Unfortunately not via the API. Right now the only way to customize the email is through Admin > Notifications.
Scott | Developer Advocate @ Shopify
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!
Can you send over the Query and GraphQL Variables you used for the request?
I'm stuck.