Skip to main content

sendSalesOrderEmail

Requires permission sales:sales_order:send.

Email a sales order to a customer address with the order PDF. Optional subject, CC addresses and a custom message. Recipients are screened for deliverability before sending.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

mutation SendSalesOrderEmail($customerEmail: String!, $salesOrderId: ID!) {
sendSalesOrderEmail(customerEmail: $customerEmail, salesOrderId: $salesOrderId) {
emailActivityId
error
message
messageId
replyToAddress
success
}
}

Variables:

{
"customerEmail": "string",
"salesOrderId": "id"
}

Response:

{
"data": {
"sendSalesOrderEmail": {
"emailActivityId": "string",
"error": "string",
"message": "string",
"messageId": "string",
"replyToAddress": "string",
"success": true
}
}
}
sendSalesOrderEmail(
ccEmail: String
customMessage: String
customerEmail: String!
salesOrderId: ID!
subject: String
): SendEmailResult!

Arguments​

sendSalesOrderEmail.ccEmail ● String scalar​

CC addresses, separated by commas or semicolons.

sendSalesOrderEmail.customMessage ● String scalar​

A message to include in the email body.

sendSalesOrderEmail.customerEmail ● String! non-null scalar​

The recipient's email address.

sendSalesOrderEmail.salesOrderId ● ID! non-null scalar​

The ID of the sales order to email.

sendSalesOrderEmail.subject ● String scalar​

Email subject. A default is used when omitted.

Type​

SendEmailResult object​

The result of sending an email.