missingFields.addMissingField("recipients", "At least one recipient must be provided");
} else {
// Primary Recipients
for (DocumentRecipient recipient : childScreeningFields.getRecipients()) {
try {
Recipient r = createRecipient(recipient);
template.addPrimaryRecipients(
new PrimaryRecipient().setRecipient(r));
} catch (MissingMandatoryFieldException e) {
missingFields.addMissingFields(e);
}
}
// Copy Recipients
if (childScreeningFields.getCopyRecipients() != null) {
for (DocumentRecipient recipient : childScreeningFields.getCopyRecipients()) {
try {
Recipient r = createRecipient(recipient);
template.addInformationOnlyRecipients(
new InformationOnlyRecipient().setRecipient(r));
} catch (MissingMandatoryFieldException e) {
missingFields.addMissingFields(e);
}