HTTP Operation Type Object DTO Why-DTOs?
(Query) documentPdfEmail DocumentPdfEmailGLDtoInput

Description

The DocumentPdfEmail service allows you to send sales documents in PDF format via email directly from the API.

This service automates the process of emailing PDF documents to specified recipients, including CC and BCC options.

Email templates can be used as a source of information to prepare the email content.

  • The DocumentPdfEmail service does not automatically apply any template.
  • The client application must first read the appropriate template and copy its content into the email fields.
img
Functionality

Input Parameters

Document Details: Specify the details of the document to be emailed.

Email Addresses: Mandatory, specify the email addresses involved in sending the PDF.

Email Content: Mandatory, specify the content of the email.

Response

The service returns a DocumentPdfEmailOutputGLDto object containing the following fields:

Key Value
Authorization Bearer Current access Token How to find?
X-TenantId Current tenant id Why deprecated ?
X-OrganizationId Current organization Id How to find?
x-api-key Primary or secondary subscription key of your app How to find?
graphQL Query
query($input: DocumentPdfEmailGLDtoInput!) {
  documentPdfEmail(input: $input) {
    type
    id
  }
}
graphQL Variables
{
  "input": {
    "type": "SALES_INVOICE",
    "id": "7af9f050-4a34-4a0b-a1af-30fe00a38abc",
    "emailFrom": "[email protected]",
    "emailTo": "[email protected]",
    "emailCc": "[email protected]",
    "sendEmailCopy": false,
    "emailSubject": "PDF document attachment",
    "emailMessage": "<b>Thank you</b> for your business.<br>Please find attached the document related to your recent transactions.<br>Let us know if you have any questions.<br>Kind regards"
  }
}
Example Response
{
    "data": {
        "documentPdfEmail": {
            "type": "SALES_INVOICE",
            "id": "0e1987c3-1f23-4906-8b26-42e4a4c36079"
        }
    }
}

documentPdfEmail Input parameters

Fields Type Description
type
  • SALES_DELIVERY_NOTE
  • SALES_INVOICE
  • SALES_ORDER
  • SALES_QUOTE
Type of the document (e.g., SALES_INVOICE)
id UUID Unique identifier of the document
emailFrom String Sender’s email address
emailTo String Primary recipient’s email address
emailCc String CC recipient’s email addresses
emailBcc String BCC recipient’s email addresses
sendEmailCopy Boolean Whether to send a copy to the sender
emailSubject String Subject of the email
emailMessage String Body content of the email
Info
  • Using Email Templates:
    The API does not automatically apply an email template when sending a document.
    If you want to use an email template, you must retrieve it using the EmailTemplate resource, then copy the template fields (subject, message, cc, bcc, etc.) into the DocumentPdfEmail input.

  • emailFrom: The email address of the currently logged-in user, from which the email will be sent.
    This email can be retrieved from the userProfile under the field authenticationEmail.

  • emailMessage: The text can be in HTML format. Notably, to manage line breaks use <br>

    Sample

    <b>Thank you</b> for your business.<br>Please find attached the document related to your recent transactions.<br>Let us know if you have any questions.<br>Kind regards
    

documentPdfEmail Response

Fields Type Description
type
  • SALES_DELIVERY_NOTE
  • SALES_INVOICE
  • SALES_ORDER
  • SALES_QUOTE
Type of the document sent
id UUID Unique identifier of the document