}
}
private boolean sendNotification(HttpServletRequest request, HttpServletResponse response, Repository db, String login, String commit, String url,
String authorName, String message) throws ServletException, URISyntaxException, IOException, JSONException, CoreException, Exception {
UserEmailUtil util = UserEmailUtil.getUtil();
if (!util.isEmailConfigured()) {
return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
"Smpt server not configured", null));
}
UserInfo userInfo = null;
try {
userInfo = OrionConfiguration.getMetaStore().readUserByProperty(UserConstants2.USER_NAME, login, false, false);
} catch (CoreException e) {
LogHelper.log(e);
return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage(),
e));
}
try {
if (reviewRequestEmail == null) {
reviewRequestEmail = new EmailContent(EMAIL_REVIEW_REQUEST_FILE);
}
String emailAdress = userInfo.getProperty(UserConstants2.EMAIL);
util.sendEmail(
reviewRequestEmail.getTitle(),
reviewRequestEmail.getContent().replaceAll(EMAIL_COMMITER_NAME, authorName).replaceAll(EMAIL_URL_LINK, url)
.replaceAll(EMAIL_COMMIT_MESSAGE, message), emailAdress);
JSONObject result = new JSONObject();