简体   繁体   English

您可以在DocuSign中存储特定信封类型的电子邮件主题/正文吗?

[英]Can you store an email subject/body for a specific envelope type in DocuSign?

Each envelope type will have its own email subject/body that is static for that envelope type. 每种信封类型都有自己的电子邮件主题/正文,该主题对于该信封类型是静态的。 Here is an example of a few predetermined envelope types: 这是一些预定的信封类型的示例:

  • Mortgage closing documents 抵押结案文件
  • Mortgage loan application documents 抵押贷款申请文件

These envelopes will contain a varied number of documents and each document is unique. 这些信封将包含不同数量的文档,并且每个文档都是唯一的。 I've attempted to create a template without a document, but it appears that is not allowed. 我试图创建一个没有文档的模板,但是似乎不允许这样做。

I'd like to be able to save the email body and subject for these envelope types so that when I send an envelope via the DocuSign API, I don't have to directly specify these fields. 我希望能够为这些信封类型保存电子邮件正文和主题,这样,当我通过DocuSign API发送信封时,不必直接指定这些字段。 I'm hoping to avoid storing the subject/body inside of code or a configuration file. 我希望避免将主题/正文存储在代码或配置文件中。 Preferably, I'd like a non-technical person to be able to change the subject/body through the DocuSign interface. 最好,我希望非技术人员能够通过DocuSign界面更改主题/身体。

What I ended up doing: 我最终要做的是:


Based on Kim Brandl's recommendations, I wrote the following code which worked as expected. 根据Kim Brandl的建议,我编写了以下符合预期的代码。 A few notes: 一些注意事项:

  1. The initial file that you added to the template will not appear in the final envelope if the ServerTemplate sequence is greater than the InlineTemplate. 如果ServerTemplate序列大于InlineTemplate,则添加到模板的初始文件将不会出现在最终信封中。 You can read more here . 您可以在这里阅读更多内容。
  2. The Recipients, signers, documents, etc., follow the same pattern as a standard EnvelopeDefinition except the data is placed under the InlineTemplate. 收件人,签名者,文档等遵循与标准EnvelopeDefinition相同的模式,只是数据位于InlineTemplate下。

     string docBase64 = Convert.ToBase64String(file.Stream.ReadAsBytes()); EnvelopeDefinition envDef = New EnvelopeDefinition(); envDef.Status = "created"; // The first sequence that appears will be the first document that is applied. // If you want the uploaded documents to appear instead of the server template, // make the server template a higher number. envDef.CompositeTemplates = new List<CompositeTemplate> { new CompositeTemplate() { ServerTemplates = new List<ServerTemplate>() { new ServerTemplate("2", templateId) }, InlineTemplates = new List<InlineTemplate>() { new InlineTemplate() { Sequence = "1", Recipients = new Recipients() { Signers = new List<Signer>() { new Signer() { Email = request.Recipients[0].UserEmail, Name = request.Recipients[0].UserName, RoleName = request.Recipients[0].RoleName, RecipientId = (1).ToString() } } }, Documents = new List<Document>() { new Document() { DocumentBase64 = docBase64, DocumentId = "3", Name = "ConsentFake.pdf", IncludeInDownload = "true" }, new Document { DocumentBase64 = docBase64, DocumentId = "9", Name = "ConsentFake2.pdf", IncludeInDownload = "true" } } } } } }; 

Summary: This allowed me to take advantage of a DocuSign template's email subject/body without having to use a specific template document. 简介:这使我可以利用DocuSign模板的电子邮件主题/正文,而不必使用特定的模板文档。

You can implement a solution for the scenario that you've described by doing the following: 您可以通过执行以下操作为所描述的方案实施解决方案:

  1. Using the DocuSign web UI, create a Template for each 'type of Envelope' and specify the Email Subject and Body in each Template that you create. 使用DocuSign Web UI,为每个“信封类型” 创建一个模板 ,并在创建的每个模板中指定电子邮件主题和正文。 You'll also need to upload a document to the Template (DocuSign requires that you add at least one document before you can save the Template) -- but you can just add any placeholder doc (for example, a .txt file that contains the word placeholder file ). 您还需要将文档上载到模板(DocuSign要求至少添加一个文档才能保存模板)-但是您可以添加任何占位符文档(例如,包含字占位符文件 )。 The document you add to the template won't actually be used in the Envelopes that you create from the Template -- since you'll use the API to specify documents at runtime. 您添加到模板中的文档实际上不会在通过模板创建的信封中使用-因为您将在运行时使用API​​指定文档。 (Non-technical folks will be able to use the DocuSign web UI to modify/update the email info in each Template at any point in the future.) (非技术人员将来可以在任何时候使用DocuSign Web UI修改/更新每个模板中的电子邮件信息。)

  2. When sending an Envelope via the API, use the compositeTemplates structure in the "Create Envelope" API request. 通过API发送信封时,请在“创建信封” API请求中使用compositeTemplates结构。 By using the compositeTemplates structure, you can specify the serverTemplate to use (which will pull in the Email Subject and Email Body that you've defined in that Template), specify recipient and tab info by using the inlineTemplate object, and specify document info using the document object. 通过使用compositeTemplates结构,您可以指定要使用的serverTemplate (它将拉入您在该模板中定义的“电子邮件主题”和“电子邮件正文”),使用inlineTemplate对象指定收件人和标签信息,并使用以下inlineTemplate指定文档信息document对象。

(There's lots of info available here on Stack Overflow about how to use compositeTemplates in the Create Envelope request. If you have trouble getting that request structure correct/working, please post a separate question.) (有关堆栈溢出的信息,这里有很多关于如何在Create Envelope请求中使用compositeTemplates的信息。如果您在使请求结构正确/正常工作时遇到困难,请提出一个单独的问题。)

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

相关问题 除了 email 主题和正文之外,我们可以通过 DocuSign ZDB974238714CA8DE4F634 传递 email header 吗? - In addtion to email subject and body, can we pass email header via DocuSign API? 您可以在 DocuSign 中将信封中的单个文档作废吗? - Can you void an individual document in an envelope in DocuSign? c#中Docusign Powerforms中的动态电子邮件主题和正文 - Dynamic Email Subject and Body in Docusign Powerforms in c# DocuSign 在使用 POST 请求发送信封时添加自定义 email 消息、主题和语言 - DocuSign add custom email message, subject, and language when sending envelope using POST request DocuSign 向用户重新发送信封并进行主题更正 - DocuSign Resend Envelope to User with Subject correction Docusign信封ID-&gt;电子邮件地址 - Docusign Envelope ID -> email address Apex 工具包 Envelope 更改 Docusign Envelope 中的发件人、主题和消息 - Apex toolkit Envelope change sender, subject and message in Docusign Envelope Docusign完成电子邮件自定义主题 - Docusign Completion email customize subject DocuSign - 在没有 API 身份验证的情况下向 email 发起信封 - DocuSign - initiate envelope to email without API authentication 如果我收到错误“无效的请求正文”,如何使用 DocuSign API 创建信封? - How can I create an envelope with the DocuSign API if I get the error “Invalid request body”?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM