Package org.eclipse.orion.server.useradmin

Examples of org.eclipse.orion.server.useradmin.UserEmailUtil


  }

  private void overrideEmailContents() throws IOException, ServletException {
    theLogger.info("Overriding Orion email templates");

    UserEmailUtil util = UserEmailUtil.getUtil();

    try {
      setModifiedEmailContent(util, EMAIL_CONFIRMATION_FILE, "confirmationEmail"); //$NON-NLS-1$
      setModifiedEmailContent(util, EMAIL_CONFIRMATION_RESET_PASS_FILE, "confirmationResetPassEmail"); //$NON-NLS-1$
      setModifiedEmailContent(util, EMAIL_PASSWORD_RESET, "passwordResetEmail"); //$NON-NLS-1$
View Full Code Here


    }
  }

  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();
View Full Code Here

TOP

Related Classes of org.eclipse.orion.server.useradmin.UserEmailUtil

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.