How to send a copy of the final signed document to the onBehalfOf email via the BoldSign API?
In BoldSign, you can configure notification settings when creating or updating a sender identity to control which email notifications are sent to the OnBehalfOf email address.
By setting the AttachSignedDocument
property to true
and enabling the Completed
notification, the final signed document will be automatically sent to the OnBehalfOf email address once the signing process is completed.
If the completed document is larger than5 MB
, it will not be attached to the email. Instead, the recipient will receive an email containing a link to download the document.
Below is a code snippet demonstrating how to update a sender identity via the API:
cURL
curl -X 'POST' \
'https://api.boldsign.com/v1/senderIdentities/update?email=luthercooper@cubeflakes.com' \
-H 'accept: */*' \
-H 'X-API-KEY: {your API key}' \
-H 'Content-Type: application/json;odata.metadata=minimal;odata.streaming=true' \
-d '{
"name": "Luther",
"redirectUrl": "https://boldsign.com",
"notificationSettings": {
"viewed": true,
"sent": false,
"deliveryFailed": true,
"declined": true,
"revoked": true,
"reassigned": true,
"completed": true,
"signed": true,
"expired": true,
"authenticationFailed": true,
"reminders": true,
"attachSignedDocument": true
},
"metaData": {
"accountPlan": "Paid"
}
}'
.Net
var apiClient = new ApiClient("https://api.boldsign.com");
apiClient.ApiKey = "Your API Key";
var senderIdentityClient = new SenderIdentityClient(apiClient);
var senderIdentityRequest = new SenderIdentityRequest("Luther", "luther@cubeflakes.com", null);
senderIdentityRequest.MetaData = new Dictionary<string, string>()
{
["accountPlan"] = "Paid"
};
senderIdentityRequest.NotificationSettings = new NotificationSettings()
{
Viewed = true,
Sent = false,
DeliveryFailedFor = true,
Declined = true,
Revoked = true,
Reassigned = true,
Completed = true,
Signed = true,
Expired = true,
AuthenticationFailed = true,
Reminders = true,
AttachSignedDocument = true
};
senderIdentityClient.UpdateSenderIdentity(senderIdentityRequest);
}
}
}
Python
import boldsign
configuration = boldsign.Configuration(api_key="YOUR_API_KEY")
with boldsign.ApiClient(configuration) as api_client:
sender_identities_api = boldsign.SenderIdentitiesApi(api_client)
sender_identity_request = boldsign.EditSenderIdentityRequest(
name="Luther",
redirect_url="https://boldsign.com",
meta_data={"accountPlan": "Paid"},
notification_settings=boldsign.NotificationSettings(
viewed=True,
sent=False,
delivery_failed=True,
declined=True,
revoked=True,
reassigned=True,
completed=True,
signed=True,
expired=True,
authentication_failed=True,
reminders=True,
attach_signed_document=True
)
)
sender_identities_api.update_sender_identities(
email="luthercooper@cubeflakes.com",
edit_sender_identity_request=sender_identity_request
)
PHP
<?php
require_once "vendor/autoload.php";
use BoldSign\Configuration;
use BoldSign\Api\SenderIdentitiesApi;
use BoldSign\Model\EditSenderIdentityRequest;
use BoldSign\Model\NotificationSettings;
$config = new Configuration();
$config->setApiKey('YOUR_API_KEY');
$sender_identities_api = new SenderIdentitiesApi($config);
$sender_identity_request = new EditSenderIdentityRequest();
$sender_identity_request->setName('Luther');
$notification_settings = new NotificationSettings();
$notification_settings->setViewed(true);
$notification_settings->setSent(false);
$notification_settings->setDeliveryFailed(true);
$notification_settings->setDeclined(true);
$notification_settings->setRevoked(true);
$notification_settings->setReassigned(true);
$notification_settings->setCompleted(true);
$notification_settings->setSigned(true);
$notification_settings->setExpired(true);
$notification_settings->setAuthenticationFailed(true);
$notification_settings->setReminders(true);
$notification_settings->setAttachSignedDocument(true);
$sender_identity_request->setNotificationSettings($notification_settings);
$sender_identities_api->updateSenderIdentities(
$email = 'luthercooper@cubeflakes.com',
$sender_identity_request
);
Java
ApiClient client = Configuration.getDefaultApiClient();
client.setApiKey("YOUR_API_KEY");
SenderIdentitiesApi senderIdentitiesApi = new SenderIdentitiesApi(client);
EditSenderIdentityRequest senderIdentityRequest = new EditSenderIdentityRequest();
senderIdentityRequest.setName("Luther");
NotificationSettings notificationSettings = new NotificationSettings();
notificationSettings.setViewed(true);
notificationSettings.setSent(false);
notificationSettings.setDeliveryFailed(true);
notificationSettings.setDeclined(true);
notificationSettings.setRevoked(true);
notificationSettings.setReassigned(true);
notificationSettings.setCompleted(true);
notificationSettings.setSigned(true);
notificationSettings.setExpired(true);
notificationSettings.setAuthenticationFailed(true);
notificationSettings.setReminders(true);
notificationSettings.setAttachSignedDocument(true);
senderIdentityRequest.setNotificationSettings(notificationSettings);
try {
senderIdentitiesApi.updateSenderIdentities("luthercooper@cubeflakes.com", senderIdentityRequest);
System.out.println("Sender identity updated successfully.");
} catch (Exception e) {
System.err.println("Exception when calling updateSenderIdentities: " + e.getMessage());
e.printStackTrace();
}
}
}
Node.js
import { SenderIdentitiesApi, EditSenderIdentityRequest,} from "boldsign";
const senderIdentitiesApi = new SenderIdentitiesApi();
senderIdentitiesApi.setApiKey("Your API Key");
const notificationSettings={
viewed: true,
sent: false,
deliveryFailed: true,
declined: true,
revoked: true,
reassigned: true,
completed: true,
signed: true,
expired: true,
authenticationFailed: true,
reminders: true,
attachSignedDocument: true
};
const senderIdentityRequest = new EditSenderIdentityRequest();
senderIdentityRequest.name = "David";
senderIdentityRequest.redirectUrl = "https://boldsign.com/request-demo/";
senderIdentityRequest.notificationSettings = notificationSettings;
senderIdentitiesApi.updateSenderIdentities("david@cubeflakes.com", senderIdentityRequest)
.then(() => {
console.log("Sender identity updated successfully.");
})
.catch((error) => {
console.error("Error updating sender identity:", error);
});
In the code examples above, set the AttachSignedDocument
property to true
and enable the Completed
notification by setting it to true
as well. With this notification configuration in place, when a document is sent using the OnBehalfOf email address, the user associated with that email will receive the final signed document as an attachment in the completion email.