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
});