@Override public void execute() { DocumentPackage template = PackageBuilder.newPackageNamed("Template " + getPackageName()) .describedAs("first message") .withEmailMessage(PACKAGE_EMAIL_MESSAGE) .withSigner( newSignerWithEmail(email1) .withFirstName(PACKAGE_SIGNER1_FIRST) .withLastName(PACKAGE_SIGNER1_LAST) .withTitle(PACKAGE_SIGNER1_TITLE) .withCompany(PACKAGE_SIGNER1_COMPANY) .withCustomId(PACKAGE_SIGNER1_CUSTOM_ID)) .withDocument( DocumentBuilder.newDocumentWithName(DOCUMENT_NAME) .fromStream(documentInputStream1, DocumentType.PDF) .withId(DOCUMENT_ID) .build()) .build(); template.setId(eslClient.getTemplateService().createTemplate(template)); DocumentPackage newPackage = PackageBuilder.newPackageNamed(getPackageName()) .describedAs(PACKAGE_DESCRIPTION) .withEmailMessage(PACKAGE_EMAIL_MESSAGE2) .withSigner( newSignerWithEmail(email2) .withFirstName(PACKAGE_SIGNER2_FIRST) .withLastName(PACKAGE_SIGNER2_LAST) .withTitle(PACKAGE_SIGNER2_TITLE) .withCompany(PACKAGE_SIGNER2_COMPANY) .withCustomId(PACKAGE_SIGNER2_CUSTOM_ID)) .withSettings( DocumentPackageSettingsBuilder.newDocumentPackageSettings() .withoutInPerson() .withoutDecline() .withoutOptOut() .withWatermark() .build()) .build(); packageId = eslClient.getTemplateService().createPackageFromTemplate(template.getId(), newPackage); retrievedPackage = eslClient.getPackage(packageId); }
@Override public void execute() { DocumentPackage template = PackageBuilder.newPackageNamed("Template " + getPackageName()) .describedAs("first message") .withEmailMessage(PACKAGE_EMAIL_MESSAGE) .withSigner(SignerBuilder.newSignerPlaceholder(new Placeholder(PLACEHOLDER_ID))) .withDocument( DocumentBuilder.newDocumentWithName(DOCUMENT_NAME) .fromStream(documentInputStream1, DocumentType.PDF) .withId(DOCUMENT_ID) .withSignature( SignatureBuilder.signatureFor(new Placeholder(PLACEHOLDER_ID)) .onPage(0) .atPosition(100, 100)) .build()) .build(); template.setId(eslClient.getTemplateService().createTemplate(template)); DocumentPackage newPackage = PackageBuilder.newPackageNamed(getPackageName()) .describedAs(PACKAGE_DESCRIPTION) .withEmailMessage(PACKAGE_EMAIL_MESSAGE2) .withSigner( newSignerWithEmail(email1) .withFirstName(SIGNER1_FIRST) .withLastName(SIGNER1_LAST) .withTitle(SIGNER1_TITLE) .withCompany(SIGNER1_COMPANY) .withCustomId(PLACEHOLDER_ID) .withAttachmentRequirement( AttachmentRequirementBuilder.newAttachmentRequirementWithName( ATTACHMENT_REQUIREMENT_NAME) .withDescription(ATTACHMENT_REQUIREMENT_DESCRIPTION) .isRequiredAttachment() .build())) .withSettings( DocumentPackageSettingsBuilder.newDocumentPackageSettings().withInPerson().build()) .build(); packageId = eslClient.getTemplateService().createPackageFromTemplate(template.getId(), newPackage); retrievedPackage = eslClient.getPackage(packageId); }