Articles in this section
Category / Section

How to use the document send API with disableEmails parameter in BoldSign?

Published:
4 mins read

The disableEmails parameter in BoldSign allows you to manage the document-related emails that are sent to recipients. By default, this parameter is set to false, meaning email notifications will be sent to all signers involved in the document workflow.

If you prefer not to send email notifications, you can set the disableEmails parameter to true when sending documents via the API. This is especially useful when generating an embedded request or signing link allowing signers to complete the document signing within your application without receiving email notifications.

To ensure you’re aware of any issues that occur during document creation, you can configure webhooks. If an error occurs, such as a failure to send the document, a Send Failed event will be triggered. This event includes an error message explaining what went wrong, allowing you to take corrective action and retry the request. Learn more: Introduction to Webhooks.

Below are code snippets demonstrating how to use the Document Send API with the disableEmails parameter set to true.
cURL

curl -X 'POST' \ 'https://api.boldsign.com/v1/document/send' \
     -H 'accept: application/json' \
     -H 'X-API-KEY: {your API key}' \
     -H 'Content-Type: multipart/form-data' \
     -F 'DisableEmails= true' \
     -F 'Message=' \
     -F 'Signers={
        "name": "Hanky",
        "emailAddress": "hankyWhites@cubeflakes.com",
        "signerType": "Signer",
        "formFields": [
           {
                "id": "string",
                "name": "string",
                "fieldType": "Signature",
                "pageNumber": 1,
                "bounds": {
                  "x": 50,
                  "y": 50,
                  "width": 1,
                  "height": 1
                   },
      "isRequired": true
    }
  ],
  "locale": "EN"
}' \
  -F 'Files={your file}' \
  -F 'Title={title}' \

.Net

var apiClient = new ApiClient("https://api.boldsign.com", "{your API key}");
var documentClient = new DocumentClient(apiClient);

var documentFilePath = new DocumentFilePath
{
   ContentType = "application/pdf",
   FilePath = "{Your file path}", 
};

var filesToUpload = new List<IDocumentFile>
{
    documentFilePath,
};

var signatureField = new FormField(
   id: "sign",
   isRequired: true,
   type: FieldType.Signature,
   pageNumber: 1,
   bounds: new Rectangle(x: 100, y: 100, width: 100, height: 50));

var formFieldCollections = new List<FormField>()
{
    signatureField
};

var signer = new DocumentSigner(
    signerName: "David",
    signerType: SignerType.Signer,
    signerEmail: "david@cubeflakes.com",
    formFields: formFieldCollections,
    locale: Locales.EN);

var documentSigners = new List<DocumentSigner>()
{
    signer
};

var sendForSign = new SendForSign()
{
   Message = "please sign this",
   Title = "Agreement",
   DisableEmails = true,
   Signers = documentSigners,
   Files = filesToUpload
};
var documentCreated = documentClient.SendDocument(sendForSign);

Python

import boldsign

configuration = boldsign.Configuration(api_key="YOUR_API_KEY")

with boldsign.ApiClient(configuration) as api_client:

    document_api = boldsign.DocumentApi(api_client)

    form_field = boldsign.FormField(
        fieldType="Signature",
        pageNumber=1,
        bounds=boldsign.Rectangle(x=50, y=50, width=200, height=25))

    document_signer = boldsign.DocumentSigner(
        name="David",
        emailAddress="david@cubeflakes.com",
        signerType="Signer",
        formFields=[form_field])

    send_for_sign = boldsign.SendForSign(
        title="Document SDK API",
        files=["YOUR_FILE_PATH"],
        signers=[document_signer],
        disableEmails= True
    )

    document_created = document_api.send_document(send_for_sign)    

PHP

<?php 
require_once "vendor/autoload.php";

use BoldSign\Configuration;
use BoldSign\Api\DocumentApi;
use BoldSign\Model\{FormField, Rectangle, DocumentSigner, SendForSign, FileInfo};

$config = new Configuration();
$config->setApiKey('YOUR_API_KEY');

$document_api = new DocumentApi($config);

$form_field = new FormField();
$form_field->setFieldType('Signature');
$form_field->setPageNumber(1);
$bounds = new Rectangle([100, 100, 100, 50]);
$form_field->setBounds($bounds);

$document_signer = new DocumentSigner();
$document_signer->setName("David");
$document_signer->setEmailAddress("david@cubeflakes.com");
$document_signer->setSignerType("Signer");
$document_signer->setFormFields([$form_field]);

$send_for_sign = new SendForSign();

$file = new FileInfo();
$file->setFilePath('YOUR_FILE_PATH');

$send_for_sign->setFiles([$file]);
$send_for_sign->setSigners([$document_signer]);
$send_for_sign->setTitle('Document SDK API');
$send_for_sign->setDisableEmails(true); 

$document_created = $document_api->sendDocument($send_for_sign);

Java

ApiClient client = Configuration.getDefaultApiClient();  
client.setApiKey("YOUR_API_KEY");
       
DocumentApi documentApi = new DocumentApi(client);

FormField signatureField = new FormField();
signatureField.setFieldType(FormField.FieldTypeEnum.SIGNATURE);
signatureField.setPageNumber(1);
Rectangle bounds = new Rectangle().x(100f).y(100f).width(100f).height(50f);
signatureField.setBounds(bounds);

DocumentSigner signer = new DocumentSigner();
signer.setName("David");
signer.setEmailAddress("david@cubeflakes.com");
signer.setSignerType(DocumentSigner.SignerTypeEnum.SIGNER);
signer.setFormFields(Arrays.asList(signatureField));

SendForSign sendForSign = new SendForSign();
File file = new File("YOUR_FILE_PATH");  
sendForSign.setFiles(Arrays.asList(file));
sendForSign.setSigners(Arrays.asList(signer));
sendForSign.setTitle("Document SDK API");
sendForSign.setDisableEmails(true); 

DocumentCreated documentCreated = documentApi.sendDocument(sendForSign);

Node.js

import { DocumentApi, DocumentSigner, FormField, Rectangle, SendForSign } from "boldsign"; 
import * as fs from 'fs';

const documentApi = new DocumentApi();
documentApi.setApiKey("YOUR_API_KEY");

const bounds = new Rectangle();
bounds.x = 100;
bounds.y = 50;
bounds.width = 100;
bounds.height = 100;

const formField = new FormField();
formField.fieldType = FormField.FieldTypeEnum.Signature;
formField.pageNumber = 1;
formField.bounds = bounds;

const documentSigner = new DocumentSigner();
documentSigner.name = "David";
documentSigner.emailAddress = "david@cubeflakes.com";
documentSigner.signerType = DocumentSigner.SignerTypeEnum.Signer;
documentSigner.formFields = [formField];

const files = fs.createReadStream("YOUR_FILE_PATH");

const sendForSign = new SendForSign();
sendForSign.title = "Agreement";
sendForSign.signers = [documentSigner];
sendForSign.files = [files];
sendForSign.disableEmails = true;

const documentCreated =documentApi.sendDocument(sendForSign);

In the above code examples, setting the disableEmails parameter to true ensures that signers will not receive document-related email notifications.

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Access denied
Access denied