Skip to content

Commit 53bb735

Browse files
authored
Merge pull request #169 from docusign/bugfix-adding-name-and-surname-to-document-visibility
Added name and email of signer to the document in Document Visibility
2 parents d8e0861 + c17bb7c commit 53bb735

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

launcher-csharp/doc_1.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
color: darkblue;">Order Processing Division</h2>
1212
<h4>Ordered by {USER_FULLNAME}</h4>
1313
<p style="margin-top:0em; margin-bottom:0em;">Email: {USER_EMAIL}</p>
14+
<p style="margin-top:0em; margin-bottom:0em;">Copy to: {CC_NAME}, {CC_EMAIL}</p>
1415
<p style="margin-top:3em;">
1516
Candy bonbon pastry jujubes lollipop wafer biscuit biscuit. Topping brownie sesame snaps sweet roll pie. Croissant danish biscuit soufflé caramels jujubes jelly. Dragée danish caramels lemon drops dragée. Gummi bears cupcake biscuit tiramisu sugar plum pastry. Dragée gummies applicake pudding liquorice. Donut jujubes oat cake jelly-o. Dessert bear claw chocolate cake gummies lollipop sugar plum ice cream gummies cheesecake.
1617
</p>

launcher-csharp/eSignature/Examples/SetDocumentVisibility.cs

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,14 @@ private static EnvelopeDefinition PrepareEnvelope(
8181
EnvelopeDefinition envelopeDefinition = new EnvelopeDefinition
8282
{
8383
EmailSubject = "Please sign this document set",
84-
Documents = PrepareDocumentsForTemplate(docPdf, docDocx, docHtml),
84+
Documents = PrepareDocumentsForTemplate(
85+
signer1Email,
86+
signer1Name,
87+
ccEmail,
88+
ccName,
89+
docPdf,
90+
docDocx,
91+
docHtml),
8592
EnforceSignerVisibility = "true",
8693
};
8794

@@ -159,11 +166,24 @@ private static Signer PrepareSigner(
159166
};
160167
}
161168

162-
private static List<Document> PrepareDocumentsForTemplate(string docPdf, string docDocx, string docHtml)
169+
private static List<Document> PrepareDocumentsForTemplate(
170+
string signer1Email,
171+
string signer1Name,
172+
string ccEmail,
173+
string ccName,
174+
string docPdf,
175+
string docDocx,
176+
string docHtml)
163177
{
164178
byte[] pdfFileContentInBytes = System.IO.File.ReadAllBytes(docPdf);
165179
byte[] docxFileContentInBytes = System.IO.File.ReadAllBytes(docDocx);
166-
byte[] htlmFileContentInBytes = System.IO.File.ReadAllBytes(docHtml);
180+
181+
string htmlFileContentsString = System.IO.File.ReadAllText(docHtml);
182+
htmlFileContentsString = htmlFileContentsString.Replace("{USER_EMAIL}", signer1Email);
183+
htmlFileContentsString = htmlFileContentsString.Replace("{USER_FULLNAME}", signer1Name);
184+
htmlFileContentsString = htmlFileContentsString.Replace("{CC_EMAIL}", ccEmail);
185+
htmlFileContentsString = htmlFileContentsString.Replace("{CC_NAME}", ccName);
186+
byte[] htlmFileContentInBytes = System.Text.Encoding.UTF8.GetBytes(htmlFileContentsString);
167187

168188
return new List<Document>
169189
{

0 commit comments

Comments
 (0)