簡體   English   中英

您可以為從批量發送生成的發件人視圖提供 returnUrlRequest 嗎?

[英]Can you have a returnUrlRequest for a sender view generated from a bulk send?

我正在嘗試創建一個工作流,用戶可以在我的應用程序中通過 docusign 進行批量發送。 他們將 select 他們想要發送 forms 的客戶簽名,顯示發件人視圖以指定他們需要哪些字段,將其發送出去,然后將其發回我的應用程序以生成用於嵌入式簽名的電子郵件。 但是,目前,盡管設置了返回 url 請求,但在用戶發送批量請求后,它不會返回到我的應用程序。 批量發送請求目前無法做到這一點嗎?

以下只是生成發送方視圖 url 的一些代碼:

// Create envelope definition 
var envelopeDefinition = new EnvelopeDefinition
{
    EmailSubject = documentDesc,
    Documents = new List<Document>(),
    Recipients = new Recipients { Signers = new List<Signer> {
        new Signer
            {
                Name = "Multi Bulk Recipient::signer",
                Email = "multiBulkRecipients-signer@docusign.com",
                RoleName = "signer",
                RoutingOrder = "1",
                Status = "sent",
                DeliveryMethod = "Email",
                RecipientId = "1",
                RecipientType = "signer"
            }
    } },
    CustomFields = new CustomFields()
    {
        TextCustomFields = new List<TextCustomField>()
        {
            new TextCustomField() {Name = "Client", Value = _config.DatabaseName},
            new TextCustomField() {Name = "Server", Value = _config.DatabaseServer},
            new TextCustomField() {Name = "DocId", Value = documentId.ToString()}
        }
    },
    EnvelopeIdStamping = "true",
};

// Read a file from disk to use as a document.
byte[] fileBytes = File.ReadAllBytes("test.pdf");
// Add a document to the envelope
Document doc = new Document();
doc.DocumentBase64 = System.Convert.ToBase64String(fileBytes);
doc.Name = "TestFile.pdf";
doc.DocumentId = "1";

envDef.Documents = new List<Document>();
envDef.Documents.Add(doc);

// Add each recipient and add them to the envelope definition
var recipients = new List<BulkSendingCopyRecipient>();
var recipients = new List<BulkSendingCopyRecipient> {
    new BulkSendingCopyRecipient
    {
        Name = "Bob Ross",
        Email = "bobross@happymistakes.com",
        ClientUserId = "1234",
        CustomFields = new List<string>()
            {
                "A custom field for internal use"
            },
        RoleName    = "signer"
    },
    new BulkSendingCopyRecipient
    {
        Name = "Fred Rogers",
        Email = "mrrogers@neighborhood.com",
        ClientUserId = "5678",
        CustomFields = new List<string>()
            {
                "Another custom field for internal use"
            },
        RoleName    = "signer"
    }
};
var bulkSendingCopy = new BulkSendingCopy
{
    Recipients = recipients
};
var bulkCopies = new List<BulkSendingCopy>
{
    bulkSendingCopy
};
var bulkSendingList = new BulkSendingList
{
    BulkCopies = bulkCopies
};
bulkSendingList.Name = "A document name";

envelopeDefinition.Status = "created";

var envelopesApi = new EnvelopesApi(config);
var bulkEnvelopesApi = new BulkEnvelopesApi();
var createBulkListResult = bulkEnvelopesApi.CreateBulkSendList(AccountId, bulkSendingList);
envelopeDefinition.CustomFields.TextCustomFields.Add(
    new TextCustomField
    {
        Name = "mailingListId",
        Required = "false",
        Show = "false",
        Value = createBulkListResult.ListId //Adding the BULK_LIST_ID as an Envelope Custom Field
    }
);
var envelopeSummary = envelopesApi.CreateEnvelope(AccountId, envelopeDefinition);

var options = new ReturnUrlRequest
{
    ReturnUrl = HttpContext.Current.Request.Url.Scheme + "://" +
                HttpContext.Current.Request.Url.Authority +
                HttpContext.Current.Request.ApplicationPath +
                "/SIP/ConfirmTagSendAndPublish.aspx?idockey=" + documentId
};

var senderView = envelopesApi.CreateSenderView(AccountId, envelopeSummary.EnvelopeId, options);
var senderViewInfo = new string[2];
senderViewInfo[0] = senderView.Url;
senderViewInfo[1] = envelopeSummary.EnvelopeId;
return senderViewInfo;

當發件人視圖出現並且您點擊發送時,它只會將我帶到 docusign 中的“已發送”選項卡

我發送后看到的

所以為了讓你做你要求做的場景,你必須采取一種稍微不同的方法:

  1. 使用您需要的東西在草稿模式下生成常規信封。

  2. 讓用戶在嵌入式發送體驗中與之交互。

  3. 使用 CreateBulkList() 方法根據來自 #2 的信封和您在代碼中添加的用戶生成批量。

(要做#3,您可能需要將自定義字段等從初始信封復制到用於自定義字段的信封)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM