public static void run(String file) { // Case file // var cf = new CaseFile("Sample Case File"); // cf.ExpireAt = new DateTime(2020, 1, 1, 1, 1, 1); // cf.SensitiveData = false; // cf.DisableNotificationsOwner = false; // cf.SignOnMeeting = false; cf.Persist(); Console.WriteLine("Case file : " + cf.Id); // Add to a folder // // var folders = Query.FindAll<Folder>(); // var folder = folders.First(); // folder.AddCaseFile(cf); // Document // var doc = new Document(cf, "Sample Document", file); doc.MakeSignable(); doc.Persist(); if (doc.Id == null) { Console.WriteLine("Unable to create a document"); return; } // Signer // var signer = new Signer(cf, "John Doe"); signer.OnBehalfOf = "Acme Corporation"; // signer.SocialSecurityNumber = "0101501111"; // signer.VATIdentificationNumber = 12345678; signer.Persist(); // Signature Line // var sigLine = new SignatureLine(doc, "dummy-signer-role") { SignOrder = 0 }; sigLine.Persist(); if (sigLine.Id == null) { Console.WriteLine("Unable to create a signature line"); return; } // Map the signer to the document using the signature line // sigLine.SetSigner(signer); // Update the signing request // var signingRequest = signer.GetSigningRequest(); if (signingRequest.Id == null) { Console.WriteLine("Unable to create the signing request"); return; } // [Optional] Send emails through Penneo // // signingRequest.Email = "*****@*****.**"; // // signingRequest.EmailSubject = "Contract for signing"; // signingRequest.EmailText = "Dear <b>{{recipient.name}}</b>. Please sign the contract using the link: {{link}}. From <b>{{sender.name}}</b>"; // // signingRequest.CompletedEmailSubect = "Completed the case file: {{casefile.title}}"; // signingRequest.CompletedEmailText = "Dear john. Case file is completed: {{casefile.title}}."; // [Optional] Email Message format // Set it to "html" if you want to control how the email looks by // using html in the email body instead of plain text. This applies // to EmailText, ReminderEmailText, and CompletedEmailText. A // prerequisite for this is that your company's account should be // configured so that you can override the default email texts. // Please get in touch with Penneo support if you have questions. // // signingRequest.EmailFormat = "html"; // [Optional] Access Control // Enable access control if you have specified a Social security // number / VAT Identification Number for the Signer // // signingRequest.AccessControl = true; // [Optional] Use touch signatures // // signingRequest.EnableInsecureSigning = true; // [Optional] Redirect after signing // // signingRequest.SuccessUrl = "https://app.penneo.com/login"; // signingRequest.FailUrl = "enter url to go to after failure here"; signingRequest.Persist(); // Create the signing request link // var link = signingRequest.GetLink(); // Active the Case file (and send signing requests if email details // are provided) // cf.Send(); // Print the link // Console.WriteLine(link); }
public bool SetSigner(PenneoConnector con, Signer signer) { Signer = signer; return(LinkEntity(con, Signer)); }
public static void run(String file) { // Case file // var cf = new CaseFile("Sample Case File"); cf.Persist(); Console.WriteLine("Case file : " + cf.Id); // Add to a folder // // var folders = Query.FindAll<Folder>(); // var folder = folders.First(); // folder.AddCaseFile(cf); // Document // var doc = new Document(cf, "Sample Document", file); doc.MakeSignable(); doc.Persist(); if (doc.Id == null) { Console.WriteLine("Unable to create a document"); return; } // Signers // var signer1 = new Signer(cf, "John Doe"); signer1.Persist(); // var signer2 = new Signer(cf, "Jane Doe"); signer2.Persist(); // Signature Lines // // We need one signature line per document-signer relationship // // Signer 1 var sigLine1 = new SignatureLine(doc, "signer-1") { SignOrder = 0 }; sigLine1.Persist(); sigLine1.SetSigner(signer1); // // Signer 2 var sigLine2 = new SignatureLine(doc, "signer-2") { // If you want to activate all the signing requests the same // time (or send emails at the same time), use the same signing // order: // SignOrder = 0 // SignOrder = 1 }; sigLine2.Persist(); sigLine2.SetSigner(signer2); // Extract the links // var signingRequest1 = signer1.GetSigningRequest(); var link1 = signingRequest1.GetLink(); var signingRequest2 = signer2.GetSigningRequest(); var link2 = signingRequest2.GetLink(); // Active the Case file (and send signing requests if email details // are provided) // cf.Send(); // Print the links // Console.WriteLine(link1); Console.WriteLine(link2); }
public bool SetSigner(Signer signer) { Signer = signer; return(LinkEntity(Signer)); }