2017-02-24 57 views
1

目前我們正在使用此方法自動將Docusign電子郵件發送到客戶端。如何不使用C#SDK自動發送Docusign信封並獲取URL

envDef.Status = "sent"; 

EnvelopesApi envelopesApi = new EnvelopesApi(); 
EnvelopeSummary envelopeSummary = envelopesApi.CreateEnvelope(accountId, envDef); 

然而,我們想不會自動發送電子郵件,而是獲取URL到的DocuSign創建文檔。

如何使用C# SDK來做到這一點?

+0

你想用URL做什麼? –

+0

我們希望將鏈接添加到使用mailto:的電子郵件中。 – user7619044

+0

您將需要使用Docusign嵌入式簽名。查看我在答案中發佈的代碼。讓我知道它是否適合你。 –

回答

1

嵌入式簽名 - 或收件人查看工作流程 - 允許用戶直接通過您的應用程序或網站登錄。當您嵌入收件人時,您告訴DocuSign平臺,您的應用程序將生成簽名URL,驗證收件人,提交簽名請求,並在交易完成後重新定向。

// set envelope status to "sent" to immediately send the signature request 
envDef.Status = "sent"; 

// |EnvelopesApi| contains methods related to creating and sending Envelopes (aka signature requests) 
EnvelopesApi envelopesApi = new EnvelopesApi(); 
EnvelopeSummary envelopeSummary = envelopesApi.CreateEnvelope(accountId, envDef); 

// Create Embedded Signing View (URL) 

RecipientViewRequest viewOptions = new RecipientViewRequest() 
{ 
    ReturnUrl = "https://www.docusign.com/devcenter", 
    ClientUserId = "1234", // must match clientUserId set in step #2! 
    AuthenticationMethod = "email", 
    UserName = envDef.Recipients.Signers[0].Name, 
    Email = envDef.Recipients.Signers[0].Email 
}; 

// create the recipient view (aka signing URL) 
ViewUrl recipientView = envelopesApi.CreateRecipientView(accountId, envelopeSummary.EnvelopeId, viewOptions); 

嵌入式發送視圖信封的允許用戶編輯選項卡,證件,收件人以及草稿信封befo的其他設置重新發送出去批准。與嵌入式簽名類似,您的應用或網站可以生成發送網址,並使用重定向,Web視圖或iFrame直接集成到您的工作流程中。

// must set status to "created" since we cannot open Sender View on an Envelope that has already been sent, only on draft envelopes 
envDef.Status = "created"; 

// |EnvelopesApi| contains methods related to creating and sending Envelopes (aka signature requests) 
var envelopesApi = new EnvelopesApi(); 
EnvelopeSummary envelopeSummary =  envelopesApi.CreateEnvelope(accountId, envDef); 

//Create Embedded Sending View (URL) 
var options = new ReturnUrlRequest(); 
options.ReturnUrl = "https://www.docusign.com/devcenter"; 

// generate the embedded sending URL 
ViewUrl senderView = envelopesApi.CreateSenderView(accountId, envelopeSummary.EnvelopeId, options); 
+1

不錯!這工作完美。謝謝! – user7619044