String msg = intres.getLocalizedMessage("services.errorworker.errornoemail", username);
log.info(msg);
} else {
// Populate end user message
log.debug("Adding to email queue for user: " + userData.getEmail());
String message = new UserNotificationParamGen(userData, cert).interpolate(getEndUserMessage());
MailActionInfo mailActionInfo = new MailActionInfo(userData.getEmail(), getEndUserSubject(), message);
userEmailQueue.add(new EmailCertData(fingerprint, mailActionInfo));
}
}
} else {
log.debug("Trying to send notification to user, but no UserData can be found for user '" + username
+ "', will only send to admin if admin notifications are defined.");
}
if (isSendToAdmins()) {
// If we did not have any user for this, we will simply use empty values for substitution
if (userData == null) {
userData = new UserDataVO();
userData.setUsername(username);
}
// Populate admin message
log.debug("Adding to email queue for admin");
String message = new UserNotificationParamGen(userData, cert).interpolate(getAdminMessage());
MailActionInfo mailActionInfo = new MailActionInfo(null, getAdminSubject(), message);
adminEmailQueue.add(new EmailCertData(fingerprint, mailActionInfo));
}
if (!isSendToEndUsers() && !isSendToAdmins()) {
// a little bit of a kludge to make JUnit testing feasible...