Docusign 电子邮件资源文件

Docusign Email Resource File

我正在尝试通过自定义演示沙盒帐户中的 "Email Resource File" 来更改 DocuSign 为各种事件(即 Completed/Voided/Declined)发送的电子邮件的内容。我什至以 "Sending Custom" 的名义创建了一个新品牌,并导入了一个示例资源并修改了 "SenderEnvelopeComplete(en)" 模板。我在其余的 api 代码中也使用了 brandid,但它正在显示我发文件的时候一直是默认模板..

当我在我的代码上使用 emailblurb 并发送文档时,一切正常,但我希望通过更改 "Email Resource File" 中的内容来更改各种事件的整个电子邮件内容。尝试看到这个“Can we customize the DocuSign response Email Blurb(Content) at runtime on each envelope?" 但它对我帮助不大.. 如果有人能给我一个清晰的镜头,那将非常有帮助.. 下面是我试图实现的目标的快照..

还有一个问题想请教,不知道这点是否可行,我同时向两个不同的收件人发送同一份文件,是否可以分别为他们发送两个不同的电子邮件内容?

演示 docusign 沙箱帐户中的品牌截图:

使用自定义 BrandId 创建文档的代码:

                    Signer signer = new Signer();

                    signer.Name = FormData.InsuredName;

                    signer.Email = FormData.InsuredEmail;
                    signer.RecipientId = "1";


                    // Create a |SignHere| tab somewhere on the document for the recipient to sign
                    signer.Tabs = new Tabs();
                    signer.Tabs.SignHereTabs = new List<SignHere>();
                    signer.Tabs.TextTabs = new List<Text>();
                    signer.Tabs.CheckboxTabs = new List<Checkbox>();
                    SignHere signHere = new SignHere();


                    for (int m = 0; m < 17; m++)
                    {
                        Text textHere = new Text();


                        if (m == 0)
                        {
                            textHere.DocumentId = "1";
                            textHere.PageNumber = (s + 1).ToString();
                            textHere.RecipientId = "1";
                            textHere.Locked = "false";
                            textHere.Font = "Arial";
                            textHere.FontSize = "4";
                            textHere.TabLabel = "Company/Insured Name";
                            textHere.XPosition = ((int)extractorCredit.FoundText.Left + 122).ToString();
                            textHere.YPosition = ((int)extractorCredit.FoundText.Top - 4).ToString();
                            textHere.Required = "false";
                        }
                        if (m == 1)
                        {
                            textHere.DocumentId = "1";
                            textHere.PageNumber = (s + 1).ToString();
                            textHere.RecipientId = "1";
                            textHere.Locked = "false";
                            textHere.Font = "Arial";
                            textHere.FontSize = "4";
                            textHere.TabLabel = "Contract/Account # (if known)";
                            textHere.XPosition = ((int)extractorCredit.FoundText.Left + 146).ToString();
                            textHere.YPosition = ((int)extractorCredit.FoundText.Top + 20).ToString();
                            textHere.Required = "false";
                        }
                        if (m == 2)
                        {

                            for (int c = 0; c < 2; c++)
                            {
                                Checkbox checkHere = new Checkbox();
                                checkHere.DocumentId = "1";
                                checkHere.PageNumber = (s + 1).ToString();
                                checkHere.RecipientId = "1";
                                if (c == 0)
                                {
                                    checkHere.TabLabel = "Credit Automatic Payments";
                                    checkHere.Required = "false";
                                    checkHere.XPosition = ((int)extractorCredit.FoundText.Left + 118).ToString();
                                    checkHere.YPosition = ((int)extractorCredit.FoundText.Top + 141).ToString();
                                }
                                else
                                {

                                    checkHere.TabLabel = "Credit Down Payments";
                                    checkHere.Required = "false";
                                    checkHere.XPosition = ((int)extractorCredit.FoundText.Left + 319).ToString();
                                    checkHere.YPosition = ((int)extractorCredit.FoundText.Top + 141).ToString();

                                }
                                signer.Tabs.CheckboxTabs.Add(checkHere);
                            }

                        }
                        if (m == 3)
                        {
                            textHere.DocumentId = "1";
                            textHere.PageNumber = (s + 1).ToString();
                            textHere.RecipientId = "1";
                            textHere.Locked = "false";
                            textHere.Font = "Arial";
                            textHere.FontSize = "4";
                            textHere.TabLabel = "Name on Card";
                            textHere.XPosition = ((int)extractorCredit.FoundText.Left + 82).ToString();
                            textHere.YPosition = ((int)extractorCredit.FoundText.Top + 170).ToString();
                            textHere.Required = "false";
                        }
                        if (m == 4)
                        {
                            textHere.DocumentId = "1";
                            textHere.PageNumber = (s + 1).ToString();
                            textHere.RecipientId = "1";
                            textHere.Locked = "false";
                            textHere.Font = "Arial";
                            textHere.FontSize = "4";
                            textHere.TabLabel = "Credit Card";
                            textHere.XPosition = ((int)extractorCredit.FoundText.Left + 82).ToString();
                            textHere.YPosition = ((int)extractorCredit.FoundText.Top + 195).ToString();
                            textHere.Required = "false";
                        }
                        if (m == 5)
                        {
                            textHere.DocumentId = "1";
                            textHere.PageNumber = (s + 1).ToString();
                            textHere.RecipientId = "1";
                            textHere.Locked = "false";
                            textHere.Font = "Arial";
                            textHere.FontSize = "4";
                            textHere.TabLabel = "Expiration Date";
                            textHere.XPosition = ((int)extractorCredit.FoundText.Left + 85).ToString();
                            textHere.YPosition = ((int)extractorCredit.FoundText.Top + 232).ToString();
                            textHere.Required = "false";
                        }
                        if (m == 6)
                        {
                            textHere.DocumentId = "1";
                            textHere.PageNumber = (s + 1).ToString();
                            textHere.RecipientId = "1";
                            textHere.Locked = "false";
                            textHere.Font = "Arial";
                            textHere.FontSize = "4";
                            textHere.TabLabel = "Expiration Year";
                            textHere.XPosition = ((int)extractorCredit.FoundText.Left + 112).ToString();
                            textHere.YPosition = ((int)extractorCredit.FoundText.Top + 232).ToString();
                            textHere.Required = "false";
                        }
                        if (m == 7)
                        {
                            textHere.DocumentId = "1";
                            textHere.PageNumber = (s + 1).ToString();
                            textHere.RecipientId = "1";
                            textHere.Locked = "false";
                            textHere.Font = "Arial";
                            textHere.FontSize = "4";
                            textHere.TabLabel = "CVV Code";
                            textHere.XPosition = ((int)extractorCredit.FoundText.Left + 236).ToString();
                            textHere.YPosition = ((int)extractorCredit.FoundText.Top + 232).ToString();
                            textHere.Required = "false";
                        }
                        if (m == 8)
                        {

                            textHere.DocumentId = "1";
                            textHere.PageNumber = (s + 1).ToString();
                            textHere.RecipientId = "1";
                            textHere.Locked = "false";
                            textHere.Font = "Arial";
                            textHere.FontSize = "4";
                            textHere.TabLabel = "Billing Address";
                            textHere.XPosition = ((int)extractorCredit.FoundText.Left + 82).ToString();
                            textHere.YPosition = ((int)extractorCredit.FoundText.Top + 257).ToString();
                            textHere.Required = "false";
                        }
                        if (m == 9)
                        {
                            textHere.DocumentId = "1";
                            textHere.PageNumber = (s + 1).ToString();
                            textHere.RecipientId = "1";
                            textHere.Locked = "false";
                            textHere.Font = "Arial";
                            textHere.FontSize = "4";
                            textHere.TabLabel = "City";
                            textHere.XPosition = ((int)extractorCredit.FoundText.Left + 82).ToString();
                            textHere.YPosition = ((int)extractorCredit.FoundText.Top + 282).ToString();
                            textHere.Required = "false";
                        }
                        if (m == 10)
                        {
                            textHere.DocumentId = "1";
                            textHere.PageNumber = (s + 1).ToString();
                            textHere.RecipientId = "1";
                            textHere.Locked = "false";
                            textHere.Font = "Arial";
                            textHere.FontSize = "4";
                            textHere.TabLabel = "State";
                            textHere.XPosition = ((int)extractorCredit.FoundText.Left + 226).ToString();
                            textHere.YPosition = ((int)extractorCredit.FoundText.Top + 282).ToString();
                            textHere.Required = "false";
                        }
                        if (m == 11)
                        {
                            textHere.DocumentId = "1";
                            textHere.PageNumber = (s + 1).ToString();
                            textHere.RecipientId = "1";
                            textHere.Locked = "false";
                            textHere.Font = "Arial";
                            textHere.FontSize = "4";
                            textHere.TabLabel = "Zip";
                            textHere.XPosition = ((int)extractorCredit.FoundText.Left + 303).ToString();
                            textHere.YPosition = ((int)extractorCredit.FoundText.Top + 282).ToString();
                            textHere.Required = "false";
                        }

                        if (m == 12)
                        {
                            textHere.DocumentId = "1";
                            textHere.PageNumber = (s + 1).ToString();
                            textHere.RecipientId = "1";
                            textHere.Locked = "false";
                            textHere.Font = "Arial";
                            textHere.FontSize = "4";
                            textHere.TabLabel = "Name(s)";
                            textHere.XPosition = ((int)extractorCredit.FoundText.Left + 55).ToString();
                            textHere.YPosition = ((int)extractorCredit.FoundText.Top + 382).ToString();
                            textHere.Required = "false";
                        }

                        if (m == 13)
                        {
                            textHere.DocumentId = "1";
                            textHere.PageNumber = (s + 1).ToString();
                            textHere.RecipientId = "1";
                            textHere.Locked = "false";
                            textHere.Font = "Arial";
                            textHere.FontSize = "4";
                            textHere.TabLabel = "Date";
                            textHere.XPosition = ((int)extractorCredit.FoundText.Left + 258).ToString();
                            textHere.YPosition = ((int)extractorCredit.FoundText.Top + 382).ToString();
                            textHere.Required = "false";
                        }

                        if (m == 14)
                        {
                            SignHere signHereAch = new SignHere();
                            signHereAch.DocumentId = "1";
                            signHereAch.PageNumber = (s + 1).ToString();
                            signHereAch.RecipientId = "1";
                            signHereAch.TabLabel = "Signature";
                            signHereAch.XPosition = ((int)extractorCredit.FoundText.Left + 58).ToString();
                            signHereAch.YPosition = ((int)extractorCredit.FoundText.Top + 410).ToString();
                            signHereAch.ScaleValue = .6;
                            signHereAch.Optional = "true";
                            signer.Tabs.SignHereTabs.Add(signHereAch);
                        }
                        if (m == 15)
                        {
                            textHere.DocumentId = "1";
                            textHere.PageNumber = (s + 1).ToString();
                            textHere.RecipientId = "1";
                            textHere.Locked = "false";
                            textHere.Font = "Arial";
                            textHere.FontSize = "4";
                            textHere.TabLabel = "Contact Phone";
                            textHere.XPosition = ((int)extractorCredit.FoundText.Left + 336).ToString();
                            textHere.YPosition = ((int)extractorCredit.FoundText.Top + 432).ToString();
                            textHere.Required = "false";
                        }
                        if (m == 16)
                        {
                            textHere.DocumentId = "1";
                            textHere.PageNumber = (s + 1).ToString();
                            textHere.RecipientId = "1";
                            textHere.Locked = "false";
                            textHere.Font = "Arial";
                            textHere.FontSize = "4";
                            textHere.TabLabel = "Email Address";
                            textHere.XPosition = ((int)extractorCredit.FoundText.Left + 82).ToString();
                            textHere.YPosition = ((int)extractorCredit.FoundText.Top + 470).ToString();
                            textHere.Required = "false";
                        }

                        signer.Tabs.TextTabs.Add(textHere);
                    }

                    envDef.Recipients.Signers.Add(signer);


        // set envelope status to "sent" to immediately send the signature request
        envDef.EnvelopeIdStamping = "false";
        envDef.Status = "sent";
        envDef.BrandId = "31682b06-6e7a-4ab6-a13a-c9cd68253389";
        //envDef.EmailBlurb = "Hi " + FormData.InsuredName + ",Please review the ***.";


        // Use the EnvelopesApi to send the signature request!
        EnvelopesApi envelopesApi = new EnvelopesApi();


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

是的,您可以设置哪个 brand 用于特定信封。来自 the docs:

用于确定信封中使用的 brandId 的规则

以下规则用于确定信封中使用的 brandId:

If a brandId is specified in the envelope/template and that brandId is available to the account, that brand is used in the envelope.

If more than one template is used in an envelope and more than one brandId is specified, the first brandId specified is used throughout the envelope.

In cases where no brand is specified and the sender belongs to a Group; if there is only one brand associated with the Group, then that brand is used in the envelope. Otherwise, the account’s default signing brand is used.

For envelopes that do not meet any of the previous rules, the account's default signing brand is used in the envelope.

通过网络界面设置品牌。请仔细编辑品牌文件!我建议您通过频繁签入将您的品牌文件置于源代码管理之下,这样您就可以在遇到问题时回溯。

问:我可以为每个收件人设置不同的消息吗?

是的。 emailblurb 字段用于普通消息。 emailNotification 字段使您能够提供特定于收件人的电子邮件设置。 API 字段是一个包含以下字段的对象:

  • 电子邮件正文:字符串 指定发送给收件人的消息的电子邮件正文。 最大长度:10000 个字符。
  • 电子邮件主题:字符串 指定发送给收件人的电子邮件的主题。 合并字段信息可以包含在电子邮件主题中。
  • supportedLanguage:string DocuSign 生成的电子邮件部分应该使用什么语言。这用于从品牌文件中提取正确的语言字段。