Skip to main content

supplyEmailPurchaseOrder

Emails a purchase order PDF to the supplier contact.

The PDF is generated client-side and sent as a base64-encoded string. The email is sent asynchronously via a background job using SendGrid. The recipient defaults to the PO's supplier contact email but can be overridden by providing a recipient_email argument.

CC emails from the client are merged with any company-level default CC addresses configured in purchase_orders.po_email_cc settings.

Authentication

Requires authentication and company membership.

Feature Flag

Requires the email_purchase_order Flipper flag to be enabled.

Possible Errors

  • **Feature not available**: The feature flag is not enabled.
  • **Purchase Order not found**: The specified purchase order does not exist or you don't have access to it.
  • **No recipient email**: No recipient email was provided and the purchase order does not have a supplier contact with an email.
  • **Invalid recipient email**: The provided email address is invalid.
  • **Invalid CC email**: One or more CC email addresses are invalid.
  • **PDF attachment is too large**: The base64 PDF exceeds the size limit.
  • **Invalid PDF data**: The provided data is not valid base64.
supplyEmailPurchaseOrder(
input: EmailPurchaseOrderInput!
): StatusResponse!

Arguments

supplyEmailPurchaseOrder.input ● EmailPurchaseOrderInput! non-null input common

Parameters for EmailPurchaseOrder

Type

StatusResponse object common

The response of a mutation that only returns a status