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

Description

The DocumentPdfEmail service allows you to send 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.

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 How to find?
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_QUOTE
  • SALES_ORDER
  • SALES_DELIVERY_NOTE
  • SALES_INVOICE
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
sendEmailCopy Boolean Whether to send a copy to the sender
emailSubject String Subject of the email
emailMessage String Body content of the email
Info
  • 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_QUOTE
  • SALES_ORDER
  • SALES_DELIVERY_NOTE
  • SALES_INVOICE
Type of the document sent
id UUID Unique identifier of the document