This service automates the process of emailing PDF documents to specified recipients, including CC and BCC options.
DocumentPdfEmail
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.
![img](/sageactive/images/resources/pdfemail.png)
Functionality
- Email Sending: Automates sending of documents in PDF format.
- Supports Different Document Types: Able to send email for various document types such as sales quotes, orders, delivery notes, and invoices.
- Customizable Email Details: Allows setting of sender, subject, and body content for the emails.
Input Parameters
Document Details: Specify the details of the document to be emailed.
- type: Mandatory, type of the document for which the PDF is requested to be emailed. (a quote, an order, a delivery note, an invoice)
- id: Mandatory, the unique identifier of the document.
Email Addresses: Mandatory, specify the email addresses involved in sending the PDF.
- emailFrom: The email address of the currently logged-in user, from which the email will be sent.
- emailTo: The primary recipient’s email address.
- emailCc: Email addresses for CC recipients.
- sendEmailCopy: Boolean indicating whether to send a copy of the email to the sender.
Email Content: Mandatory, specify the content of the email.
- emailSubject: The subject of the email.
- emailMessage: The body content of the email, can be in HTML format. Notably, to manage line breaks use <br>.
Response
The service returns a DocumentPdfEmailOutputGLDto
object containing the following fields:
- type: type of the document for which the PDF is requested to be emailed.
- id: the unique identifier of the document.
Header
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? |
How to use the DocumentPdfEmail service?
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
{
"type": "SALES_INVOICE",
"id": "7af9f050-4a34-4a0b-a1af-30fe00a38abc"
}
documentPdfEmail Input parameters
Fields | Type | Description |
---|---|---|
type |
|
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 |
|
Type of the document sent |
id | UUID | Unique identifier of the document |