Sending email only when the mail transport is enabled.

revert-70aa11f8
sinthuja 7 years ago
parent 3edc71f04d
commit a1d6065c75

@ -71,12 +71,14 @@ public class EmailSenderServiceImpl implements EmailSenderService {
if(EmailSenderDataHolder.getInstance().getConfigurationContextService() if(EmailSenderDataHolder.getInstance().getConfigurationContextService()
.getServerConfigContext().getAxisConfiguration().getTransportOut(transportSenderName) == null){ .getServerConfigContext().getAxisConfiguration().getTransportOut(transportSenderName) == null){
log.warn("Email invitation is not sent as the email is not configured."); log.warn("Email invitation is not sent as the email is not configured.");
} else {
threadPoolExecutor.submit(new EmailSender(recipient, emailData.getSubject(), emailData.getBody()));
} }
} catch (ContentProcessingInterruptedException e) { } catch (ContentProcessingInterruptedException e) {
throw new EmailSendingFailedException("Error occurred while retrieving email content to be " + throw new EmailSendingFailedException("Error occurred while retrieving email content to be " +
"sent for recipient '" + recipient + "'", e); "sent for recipient '" + recipient + "'", e);
} }
threadPoolExecutor.submit(new EmailSender(recipient, emailData.getSubject(), emailData.getBody()));
} }
} }

Loading…
Cancel
Save