0

I have the Soap API working to get a token back to load the document via an IFrame and allow the users to sign. However, I need to get it so that the document can also be sent to others that are not there for the signing. As I understood things there should be a way to use a workflow to send the document to a series of email addresses to be signed in a specific order. However, I have yet to find anything in the documentation that shows this. I have searched google for this as well. Docusign sales groups says either buy support time or use Stackoverflow so I am here.

I currently have code that will create the document in the Docusign system and I can see in the "Waiting for Others" section that the documents are there and waiting for customers. However, I never get the emails at any addresses. Below is the code that I use to call the service.

I have checked all email accounts and they do not have any docusign addresses blocked and nothing is in any spam folders.

public void CreateDocs(string emailSubject, List<FileToSign> files, IEnumerable<Recipient> recipents, IEnumerable<Tab> tabs)
{
var envelope = new Envelope
{
    Subject = emailSubject,
    EmailBlurb = emailSubject,
    AccountId = _apiAccountId,
    Recipients = recipents.ToArray(),
    Documents = files.Select((t, i) => new Document
    {
        PDFBytes = File.ReadAllBytes(t.PathToFile),
        Name = t.DocumentName,
        ID = (i + 1).ToString(),
        FileExtension = t.Extension
    }).ToArray(),
    Tabs = tabs.ToArray()
};

using (var client = new DSAPIServiceSoapClient("DSAPIServiceSoap"))
{
    EnvelopeStatus status;
    using (new OperationContextScope(client.InnerChannel))
    {
        var httpRequestProperty = new HttpRequestMessageProperty();
        httpRequestProperty.Headers.Add("X-DocuSign-Authentication", _auth);
        OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = httpRequestProperty;
        status = client.CreateAndSendEnvelope(envelope);
    }
    if (!status.SentSpecified) return;
    EnvelopeStatus = status;
}
}

EDIT: Adding sample recipient:

            Recipients.Add(new Recipient
        {
            UserName = row["FirstSigner"].ToString(),
            Email = row["SignerEmail"].ToString(),
            ID = "1",
            Type = RecipientTypeCode.Signer,
            CaptiveInfo = new RecipientCaptiveInfo { ClientUserId = "1" },
            RoleName = "Signer1",
            RoutingOrder = 1
        });
stanley
  • 143
  • 1
  • 1
  • 9
  • Can you show us the properties you have set in `IEnumerable recipents` Its hard to tell without seeing your entire code. – Praveen Reddy Apr 20 '17 at 17:01
  • I am curious if there is a reason for you to use the DocuSign SOAP api. The DocuSign [REST api](https://docs.docusign.com/esign/) has richer features and has an easy to use [c# SDK](https://github.com/docusign/docusign-csharp-client) – Praveen Reddy Apr 20 '17 at 23:44

1 Answers1

2

You are designating your signers as Embedded recipients (aka captive recipients)

Embedded Signing - or the Recipient View workflow - allows users to sign directly through your app or website. When you embed your recipients you are telling the DocuSign platform your app will generate signing URLs, authenticate your recipients, present the signing request, and re-direct once the transaction is complete.

If you want to also send an email to the embedded recipients you will have to set the embeddedRecipientStartURL in addition to clientUserId See this answer.

Modify your code and add the EmbeddedRecipientStartURL

    Recipients.Add(new Recipient
    {
        UserName = row["FirstSigner"].ToString(),
        Email = row["SignerEmail"].ToString(),
        ID = "1",
        Type = RecipientTypeCode.Signer,
        CaptiveInfo = new RecipientCaptiveInfo
        { 
            ClientUserId = "1",
            EmbeddedRecipientStartURL = "<Url to your App>"
        },
        RoleName = "Signer1",
        RoutingOrder = 1
    });

See more information about EmbeddedRecipientStartURL here

EmbeddedRecipientStartURL is a sender provided valid URL string for redirecting an embedded recipient. When using this option, the embedded recipient still receives an email from DocuSign, just as a remote recipient would, but when the document link in the email is clicked the recipient is redirected, through DocuSign, to this URL to complete their actions. When routing to the URL, it is up to the sender’s system (the server responding to the URL) to then request a recipient token to launch a signing session.

Community
  • 1
  • 1
Praveen Reddy
  • 7,295
  • 2
  • 21
  • 43