简体   繁体   English

您可以为从批量发送生成的发件人视图提供 returnUrlRequest 吗?

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

I'm trying to create a workflow where a user can do a bulk send through docusign within my application.我正在尝试创建一个工作流,用户可以在我的应用程序中通过 docusign 进行批量发送。 They would select the clients they want to send forms to for a signature, be presented with a sender view to specify what fields they require, send it off, then have it post back to my application in order to generate emails for embedded signing.他们将 select 他们想要发送 forms 的客户签名,显示发件人视图以指定他们需要哪些字段,将其发送出去,然后将其发回我的应用程序以生成用于嵌入式签名的电子邮件。 However, currently, it doesn't return back to my application after the user has sent off the bulk request despite the return url request being set.但是,目前,尽管设置了返回 url 请求,但在用户发送批量请求后,它不会返回到我的应用程序。 Is this currently not possible with a bulk send request?批量发送请求目前无法做到这一点吗?

The following is just some code to generate the sender view 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;

When the sender view comes up and you hit send it just takes me to the Sent tab in docusign当发件人视图出现并且您点击发送时,它只会将我带到 docusign 中的“已发送”选项卡

What I see after send我发送后看到的

So in order for you to do the scenario you're asking to do, you will have to take a slightly different approach:所以为了让你做你要求做的场景,你必须采取一种稍微不同的方法:

  1. Generate a regular envelope in draft mode with the things you need.使用您需要的东西在草稿模式下生成常规信封。

  2. Have user interact with it in embedded sending experience.让用户在嵌入式发送体验中与之交互。

  3. Generate a bulk using the CreateBulkList() method based on the envelope from #2 and the users you add like in your code.使用 CreateBulkList() 方法根据来自 #2 的信封和您在代码中添加的用户生成批量。

(to do #3 you may need to copy custom fields etc. from the initial envelope to the one used for custom fields) (要做#3,您可能需要将自定义字段等从初始信封复制到用于自定义字段的信封)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM