-3
我試圖通過API發送電子郵件,但它給我所有電子郵件地址的錯誤爲「收件人的電子郵件地址無效,收件人ID隨後出現」。在此先感謝如何將文檔應用到現有模板
試圖通過API做幾件事情。
- 手動將我們現有的所有模板上傳到docusing(dpd格式中有大約10個模板)。
在我們的服務器上創建文檔。
通過API創建信封。
- 將創建的文檔應用於docusing中的正確模板。 (我試圖做到這一點 - 附代碼)
發送信封。 (我在這裏得到錯誤)
將簽名文件下載回服務器。 - (完成)
。
public void ApplyToTemplate()
{
//// Create the recipient information
//recipient1
DocuSignWeb.Recipient recipient1 = new DocuSignWeb.Recipient();
recipient1.UserName = "Client";
recipient1.Email = "[email protected]";
recipient1.Type = DocuSignWeb.RecipientTypeCode.Signer;
recipient1.RequireIDLookup = false;
recipient1.RequireIDLookupSpecified = true;
recipient1.RoutingOrder = 1;
recipient1.RoutingOrderSpecified = true;
recipient1.RoleName = "Client";
recipient1.ID = "1";
DocuSignWeb.Recipient[] recipients = new DocuSignWeb.Recipient[] { recipient1 };
// Create the template reference from a server-side template ID
DocuSignWeb.TemplateReference templateReference = new DocuSignWeb.TemplateReference();
templateReference.Template = "XXXX";
templateReference.TemplateLocation = DocuSignWeb.TemplateLocationCode.Server;
//templateReference.Document = new DocuSignWeb.Document();
//templateReference.Document.PDFBytes = ConvertWordToPdfByte(@"c:\temp\a.doc");
// Construct the envelope information
DocuSignWeb.EnvelopeInformation envelopeInfo = new DocuSignWeb.EnvelopeInformation();
envelopeInfo.AccountId = "XXXXX";
envelopeInfo.Subject = "hello from API";
envelopeInfo.EmailBlurb = "hello";
// Create draft with all the template information
DocuSignWeb.EnvelopeStatus status = _apiClient.CreateEnvelopeFromTemplates(new DocuSignWeb.TemplateReference[] { templateReference }, recipients, envelopeInfo, false);
DocuSignWeb.EnvelopeStatus sendStatus = _apiClient.SendEnvelope(status.EnvelopeID, envelopeInfo.AccountId);
}