this.submissionNotifier = new SubmissionMailNotifierNull();
} else {
// Create mail notification
MailNotificationImpl mail = null;
SubmissionMailNotifierImpl submissionNotifier = null;
try {
MailDeliveryImpl mailDelivery = new MailDeliveryImpl();
mailDelivery.setMailProperties(props);
servletContext.setAttribute(MailDelivery.ConfigAttributeName_MailDelivery, mailDelivery);
mail = new MailNotificationImpl(
atlasProperties.getAtlasName()
,mailDelivery
,couchDd.getDatabase()
);
mail.setMailProperties(props);
// Mail templates
{
MailMessageGenerator template = new UploadNotificationGenerator();
CouchDbTemplateMailMessageGenerator couchdbTemplate = new CouchDbTemplateMailMessageGenerator(
documentDatabase,
"org.nunaliit.email_template.upload",
template
);
mail.setUploadNotificationGenerator(couchdbTemplate);
}
{
MailMessageGenerator template = new DailyVetterNotificationGenerator();
CouchDbTemplateMailMessageGenerator couchdbTemplate = new CouchDbTemplateMailMessageGenerator(
documentDatabase,
"org.nunaliit.email_template.daily_vetter",
template
);
mail.setDailyVetterNotificationGenerator(couchdbTemplate);
}
submissionNotifier = new SubmissionMailNotifierImpl(
atlasProperties.getAtlasName()
,mailDelivery
,couchDd.getDatabase()
);
submissionNotifier.parseMailProperties(props);
// Mail templates
{
MailMessageGenerator template = new SubmissionApprovalGenerator();
CouchDbTemplateMailMessageGenerator couchdbTemplate = new CouchDbTemplateMailMessageGenerator(
documentDatabase,
"org.nunaliit.email_template.submission_approval",
template
);
submissionNotifier.setApprovalGenerator(couchdbTemplate);
}
{
MailMessageGenerator template = new SubmissionRejectionGenerator();
CouchDbTemplateMailMessageGenerator couchdbTemplate = new CouchDbTemplateMailMessageGenerator(
documentDatabase,
"org.nunaliit.email_template.submission_rejection",
template
);
submissionNotifier.setRejectionGenerator(couchdbTemplate);
}
mailNotification = mail;
this.submissionNotifier = submissionNotifier;