Skip to content

Commit 13e6e07

Browse files
Merge pull request #20 from sriharip-docusign/flow_338
FLOW-338: template prefill : in create from template action , add support for email subject and body
2 parents b05c281 + 202484c commit 13e6e07

File tree

2 files changed

+29
-26
lines changed

2 files changed

+29
-26
lines changed

certified-connectors/DocuSignDemo/apiDefinition.swagger.json

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,12 +667,31 @@
667667
"in": "body",
668668
"description": "The signers of the document.",
669669
"x-ms-visibility": "important",
670-
"required": true,
670+
"required": false,
671671
"schema": {
672672
"$ref": "#/definitions/DynamicSigners"
673673
},
674674
"x-ms-summary": "Signers"
675-
}
675+
},
676+
{
677+
"name": "emailSubject",
678+
"in":"query",
679+
"description": "Email subject",
680+
"required":false,
681+
"x-ms-summary": "Email subject",
682+
"type":"string",
683+
"x-ms-visibility": "advanced"
684+
},
685+
{
686+
"name": "emailBody",
687+
"in":"query",
688+
"description": "Email body",
689+
"required":false,
690+
"x-ms-summary": "Email body",
691+
"type":"string",
692+
"x-ms-visibility": "advanced"
693+
694+
},
676695
],
677696
"responses": {
678697
"201": {

certified-connectors/DocuSignDemo/script.csx

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -857,9 +857,11 @@ public class Script : ScriptBase
857857

858858
var newBody = new JObject()
859859
{
860-
["templateId"] = query.Get("templateId")
860+
["templateId"] = query.Get("templateId"),
861+
["emailSubject"] = query.Get("emailSubject"),
862+
["emailBlurb"] = query.Get("emailBody")
861863
};
862-
864+
863865
foreach (var property in body)
864866
{
865867
var value = (string)property.Value;
@@ -870,16 +872,6 @@ public class Script : ScriptBase
870872
signer["roleName"] = key.Substring(0, key.Length - 5);
871873
signer["name"] = value;
872874
}
873-
874-
if (key.Contains("Email subject"))
875-
{
876-
newBody["emailSubject"] = value;
877-
}
878-
879-
if (key.Contains("Email body"))
880-
{
881-
newBody["emailBlurb"] = value;
882-
}
883875

884876
//add every (name, email) pairs
885877
if (key.Contains(" Email"))
@@ -1642,19 +1634,11 @@ public class Script : ScriptBase
16421634

16431635
var signers = (body["signers"] as JArray) ?? new JArray();
16441636

1645-
if (signers.Count == 0)
1646-
{
1647-
itemProperties["Email subject"] = basePropertyDefinition.DeepClone();
1648-
itemProperties["Email body"] = basePropertyDefinition.DeepClone();
1649-
}
1650-
else
1637+
foreach (var signer in signers)
16511638
{
1652-
foreach (var signer in signers)
1653-
{
1654-
var roleName = signer["roleName"];
1655-
itemProperties[roleName + " Name"] = basePropertyDefinition.DeepClone();
1656-
itemProperties[roleName + " Email"] = basePropertyDefinition.DeepClone();
1657-
}
1639+
var roleName = signer["roleName"];
1640+
itemProperties[roleName + " Name"] = basePropertyDefinition.DeepClone();
1641+
itemProperties[roleName + " Email"] = basePropertyDefinition.DeepClone();
16581642
}
16591643

16601644
var newBody = new JObject

0 commit comments

Comments
 (0)