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

fazlul_kabir
Shopify Partner
6 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 3 (3)

SBD_
Shopify Staff
1829 270 412

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
6 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
1829 270 412

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

Scott | Developer Advocate @ Shopify