PMG
PMG

Reputation: 23

How to populate a docusign template using a C# dictionary?

How can I populate a docusign template using a C# dictionary via the docusign .Net client?

I read somewhere a docusign template with custom html but could not find any examples online.

Upvotes: 2

Views: 626

Answers (1)

Inbar Gazit
Inbar Gazit

Reputation: 14015

the Envelope object has a couple of fields you will need:

TemplateId - is like an EnvelopeId a GUID for a unique template

TemplateRoles - is a collection of TemplateRole objects that represents the roles/recipients for this template.

In order to get this information for a given template - you would need to call use the Template class and call the GetTemplate() method/API to get all information for a template. this would include the roles/recipients (As well a more things in the json, which we just pass back as is) here is the important things:

       var recipients = json["recipients"];
       var subject = (string)json["emailSubject"];
       var blurb = (string)json["emailBlurb"];

I can share a bit more code of looping through the recipients and adding them to the TemplateRoles if you want. Let me know if this is the direction you want to go and how else I can help.

Upvotes: 1

Related Questions