Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
raileendr committed Mar 27, 2024
2 parents 1970cb1 + 53bb735 commit 9fac5b9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
1 change: 1 addition & 0 deletions launcher-csharp/doc_1.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
color: darkblue;">Order Processing Division</h2>
<h4>Ordered by {USER_FULLNAME}</h4>
<p style="margin-top:0em; margin-bottom:0em;">Email: {USER_EMAIL}</p>
<p style="margin-top:0em; margin-bottom:0em;">Copy to: {CC_NAME}, {CC_EMAIL}</p>
<p style="margin-top:3em;">
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.
</p>
Expand Down
26 changes: 23 additions & 3 deletions launcher-csharp/eSignature/Examples/SetDocumentVisibility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,14 @@ private static EnvelopeDefinition PrepareEnvelope(
EnvelopeDefinition envelopeDefinition = new EnvelopeDefinition
{
EmailSubject = "Please sign this document set",
Documents = PrepareDocumentsForTemplate(docPdf, docDocx, docHtml),
Documents = PrepareDocumentsForTemplate(
signer1Email,
signer1Name,
ccEmail,
ccName,
docPdf,
docDocx,
docHtml),
EnforceSignerVisibility = "true",
};

Expand Down Expand Up @@ -159,11 +166,24 @@ private static Signer PrepareSigner(
};
}

private static List<Document> PrepareDocumentsForTemplate(string docPdf, string docDocx, string docHtml)
private static List<Document> PrepareDocumentsForTemplate(
string signer1Email,
string signer1Name,
string ccEmail,
string ccName,
string docPdf,
string docDocx,
string docHtml)
{
byte[] pdfFileContentInBytes = System.IO.File.ReadAllBytes(docPdf);
byte[] docxFileContentInBytes = System.IO.File.ReadAllBytes(docDocx);
byte[] htlmFileContentInBytes = System.IO.File.ReadAllBytes(docHtml);

string htmlFileContentsString = System.IO.File.ReadAllText(docHtml);
htmlFileContentsString = htmlFileContentsString.Replace("{USER_EMAIL}", signer1Email);
htmlFileContentsString = htmlFileContentsString.Replace("{USER_FULLNAME}", signer1Name);
htmlFileContentsString = htmlFileContentsString.Replace("{CC_EMAIL}", ccEmail);
htmlFileContentsString = htmlFileContentsString.Replace("{CC_NAME}", ccName);
byte[] htlmFileContentInBytes = System.Text.Encoding.UTF8.GetBytes(htmlFileContentsString);

return new List<Document>
{
Expand Down

0 comments on commit 9fac5b9

Please sign in to comment.