@@ -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