如何将过期设置设置为“信封定义”?

时间:2019-07-10 11:30:04

标签: c# docusignapi

我正在尝试将过期设置设置为“信封定义”,但无法设置。

我将以下内容用作创建和发送信封的参考:
https://github.com/docusign/docusign-csharp-client/blob/master/test/Recipes/CoreRecipes.cs

我已经尝试了以下方法:

envDef.ExpireAfter = "1";
envDef.ExpireEnabled = "true";
envDef.ExpireDateTime = DateTime.Now.AddDays(1).ToString("dd MMM yyyy hh:mm ff");

文档确实会发送我设置的所有其他设置,但是,尽管有上述设置,但没有设置过期设置。

2 个答案:

答案 0 :(得分:0)

您需要在客户端的C#模型中使用Expiration类。 该对象将具有3个字段(https://github.com/docusign/docusign-csharp-client/blob/1d125f362ba8ae33edc2a72a713fc1e6e8b55314/sdk/src/DocuSign.eSign/Model/Expirations.cs) ExpireAfter-字符串,表示信封将状态更改为“已发送”后将过期的天数 ExpireWarn-信封过期前几天的字符串,您将通过电子邮件向用户发出警告,提醒信封即将过期。
ExpireEnabled-“ true”-允许您自定义信封(相对于使用帐户默认设置)

我认为,如果ExpireAfter == ExpireWarn,则不会发送该电子邮件。 我认为您可以将ExpireAfter设置为1,将ExpireWarn设置为0,这应该会立即生成一封电子邮件,但我尚未对其进行测试。否则-需要等待一天进行测试。...

答案 1 :(得分:0)

如Inbar所述,您需要创建一个Expirations对象并将其应用于信封定义。根据{{​​3}},您可以这样做:

var expirations = new Expirations("1", "true", "0"); //ExpireAfter, Enabled, Warning days
var reminders = new Reminders("0", "true", "0");  //ReminderDelay, Enabled, Frequency
//results in no reminders and no expiration warning sent, envelope expires one day after sending

然后将其应用于envelopeDefinition.Notification参数

envelopeDefinition.Notification = new Notification(expirations, reminders, "false"); //Expirations, Reminders, UseDefaults