Reputation: 193
After reading (here and here) and trying out composite templates, I'm not quite sure I understand how to properly use the Server Templates within the API request. The documentation mentions If supplied they are overlaid into the envelope in the order of their Sequence value
so I've interpreted this as they would be merged together as one document. It seems they are merged together but it is yielding a result that I would not expect. The first one in the sequence is what is shown and you cannot see the others.
What I'd like to do is have a couple common headers that contain our different logos and combine that with whatever template I'm sending out. We cannot use the branding approach because they want it as part of the document within the template and as far as I can tell, there is no way to make that happen with branding.
Below is my (scrubbed) request. See my comments.
{
"brandId": "{{brandId}}",
"emailSubject": "Testing Subject",
"status": "SENT",
"compositeTemplates": [{
"serverTemplates": [{ // First document
"sequence": "1",
"templateId": "{{headerTemplateId}}" //Header logo template
}, {
"sequence": "2",
"templateId": "{{document1TemplateId}}" // Template with content
}
],
"inlineTemplates": [{
"sequence": "1",
"recipients": {
"signers": [{
"email": "[email protected]",
"name": "Leeroy Jenkins",
"roleName": "Customer",
"recipientId": "1"
}
]
}
}
]
}, {
"serverTemplates": [{ // Second document
"sequence": "2",
"templateId": "{{document2TemplateId}}"
}
],
"inlineTemplates": [{
"sequence": "2",
"recipients": {
"signers": [{
"email": "[email protected]",
"name": "Leeroy Jenkins",
"roleName": "Customer",
"recipientId": "1",
"tabs": {
"textTabs": [{
"tabLabel": "Address",
"value": "123 Test Rd "
}, {
"tabLabel": "CityStateZip",
"value": "Test/XY/12345"
}
]
}
}
]
}
}
]
}
]
}
Upvotes: 0
Views: 1175
Reputation: 49104
As @Drew says, your immediate issue is that each individual composite template can only include zero or one server template.
Each composite template composites together different aspects of an envelope:
For example, composite templates can be used to create an envelope that includes document "B" instead of using the document included in a template on docusign.com.
Unfortunately, the DocuSign compositing feature does not include a feature for combining the images from one document with another document to create a new (combined) document.
Some ideas:
If only page one of the contract includes the logo, then you could have multiple versions of page one (treating each as a separate document), and combine the logoed page one with the other pages to form a complete envelope.
Note that a document can be as short as a page. Recipients will view all of the envelope's documents together.
Use a PDF library to manipulate the PDF document itself to change the logo. There are now many PDF libraries available, with APIs for many languages and operating systems.
Use a SAAS PDF rendering service to combine the images with the content to obtain the final PDF. Eg, webmerge
Send DocuSign the document in a non-PDF format. For example, you can send a .docx document. If you're using the Windows stack, it may be easier for your application to create a custom logo version of a Word doc than a PDF.
Upvotes: 1