sendPurchaseOrderEmail
Requires permission purchase:purchase_order:update.
Emails a purchase order to the supplier and returns success with a message. Needs the purchase order update permission and the purchase orders feature on your plan.
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:
- GraphQL
- cURL
mutation SendPurchaseOrderEmail($purchaseOrderId: ID!, $recipientEmail: String!) {
sendPurchaseOrderEmail(
purchaseOrderId: $purchaseOrderId
recipientEmail: $recipientEmail
) {
emailActivityId
error
message
messageId
replyToAddress
success
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation SendPurchaseOrderEmail($purchaseOrderId: ID!, $recipientEmail: String!) {\n sendPurchaseOrderEmail(\n purchaseOrderId: $purchaseOrderId\n recipientEmail: $recipientEmail\n ) {\n emailActivityId\n error\n message\n messageId\n replyToAddress\n success\n }\n}",
"variables": {
"purchaseOrderId": "id",
"recipientEmail": "string"
}
}
EOF
Variables:
{
"purchaseOrderId": "id",
"recipientEmail": "string"
}
Response:
{
"data": {
"sendPurchaseOrderEmail": {
"emailActivityId": "string",
"error": "string",
"message": "string",
"messageId": "string",
"replyToAddress": "string",
"success": true
}
}
}
sendPurchaseOrderEmail(
message: String
purchaseOrderId: ID!
recipientEmail: String!
subject: String
): SendEmailResult!
Arguments
sendPurchaseOrderEmail.message ● String scalar
The message text. Omit for the default text.
sendPurchaseOrderEmail.purchaseOrderId ● ID! non-null scalar
The ID of the purchase order.
sendPurchaseOrderEmail.recipientEmail ● String! non-null scalar
The email address to send to.
sendPurchaseOrderEmail.subject ● String scalar
The email subject. Omit for the default subject.
Type
SendEmailResult object
The result of sending an email.