0
votes

We use DocuSign to request signatures from business partners. For each campaing, we create a template in DocuSign with the required documents and SignHere tabs (Places to sign) placed in those documents. and these SignHere tabs are associated to a Signer that is defined in the template.

When we are ready to send the documents to the users to sign (an envelope), we want to use the above template. but the name and email of the signer should change for each envelope.

We have tried (Assume that the template we provide here has a signer with the role Partner)

  1. Providing the TemplateRoles

        var envelope = new EnvelopeDefinition
        {
            TemplateId = "...",
            TemplateRoles = new List<TemplateRole>
            {
                new TemplateRole
                {
                    RoleName = "Partner",
                    Name = "John Doe",
                    Email = "jd@x.com",
    
                }
            },
            EmailSubject = "...",
            Status = "created"
        };
    
        var result = await envelopeApi.CreateEnvelopeAsync(accountId, envelope); 
    
  2. Using CompositeTemplate

        var envelope = new EnvelopeDefinition
        {
            CompositeTemplates = new List<CompositeTemplate>
            {
                new CompositeTemplate
                {
                    ServerTemplates = new List<ServerTemplate>
                    {
                        new ServerTemplate
                        {
                            TemplateId = templateId,
                            Sequence = "1",
                        }
                    },
                    InlineTemplates = new List<InlineTemplate>
                    {
                        new InlineTemplate
                        {
                            Sequence = "2",
                            Recipients = new Recipients
                            {
                                Signers = new List<Signer>
                                {
                                    new Signer
                                    {
                                        RoleName = "Partner",
                                        Name = "John Doe",
                                        Email = "jd@x.com",
                                        RecipientId = "1"
    
                                    }
                                }
                            }
                        }
                    }
                }
            },
            EmailSubject = "...",
            Status = "created"
        };
    
        var result = await envelopeApi.CreateEnvelopeAsync(accountId, envelope); 
    

But in both cases, it doesn't update the name and email but it adds a new signer to the envelope along with the signer existing in the template. (This is not what we want).

How can we do that using the .Net SDK ?

Thank you.

2
Please read the how to ask and edit your question accordingly. Right now it is highly unlikely that anyone really understands what your problem is.FeRaaC
@FeRaaC Check the updated question.Shanaka Rusith

2 Answers

1
votes

When you create a template in DocuSign, you have 2 types of recipients: 1. Fixed recipients, which are defined with user/email. 2. Placeholders. these only have a "RoleName" but they are not filled with email and name. They must be updated before sending the envelope or you'll get an error.

I suspect (not sure) your envelope is using the #1 type of recipients. Your use-case suggest you need the #2.

With the #2 you must ensure that the RoleName is exactly the same (case sensitive) as in the template. Then all you have to do is create the envelope from the templates and provide the recipients in the API call (PUT) to update the recipients.

And yes, you can do this from the C# code. The EnvelopeDefinition class also has a TemplateId which you can use to just pass which template to use to create the envelope from as well as TemplateRoles which will go to the recipients.

(there's no need to use composite templates for this simple case)

0
votes

Here's a C# example of setting a template's role to someone:

EnvelopeDefinition env = new EnvelopeDefinition();
env.TemplateId = templateId;

TemplateRole signer1 = new TemplateRole();
signer1.Email = signerEmail;
signer1.Name =  signerName;
signer1.RoleName = "signer";

TemplateRole cc1 = new TemplateRole();
cc1.Email = ccEmail;
cc1.Name = ccName;
cc1.RoleName = "cc";

env.TemplateRoles = new List<TemplateRole> { signer1, cc1 };
env.Status = "sent";