Package ca.carleton.gcrc.mail

Examples of ca.carleton.gcrc.mail.MailMessage


    }

    logger.info("Sending mail notification for "+docId+" to "+recipients);
   
    try {
      MailMessage message = new MailMessage();
     
      // To
      for(MailRecipient recipient : recipients){
        message.addToRecipient( recipient );
      }
     
      // Subject
      message.setSubject("Uploaded Media - "+docId);
     
      // Create HTML body part
      StringWriter sw = new StringWriter();
      PrintWriter pw = new PrintWriter(sw);
      pw.println("<html><head><title>Upload Notification</title></head><body><h1>Upload Notification</h1>");
      pw.println("<p>A media was uploaded to the atlas with the following details:</p>");
      pw.println("<table>");
      pw.println("<tr><td>ID</td><td>"+docId+"</td></tr>");
      pw.println("<tr><td>Attachment</td><td>"+attachmentName+"</td></tr>");
      pw.println("</table>");
      if( null != approvalPageLink ) {
        pw.println("<p>The page where uploaded media can be approved is located at: <a href=\""+approvalPageLink+"\">"+approvalPageLink+"</a></p>");
      }
      pw.println("</body></html>");
      pw.flush();
      message.setHtmlContent(sw.toString());
     
      // Send message
      mailDelivery.sendMessage(message);
     
    } catch (Exception e) {
View Full Code Here


    }

    logger.info("Sending daily vetter notification for "+count+" files to "+recipients);
   
    try {
      MailMessage message = new MailMessage();
     
      // To
      for(MailRecipient recipient : recipients){
        message.addToRecipient( recipient );
      }
     
      // Subject
      message.setSubject("Uploaded Media - "+count+" file"+(count>1?"s":"")+" pending for approval");
     
      // Create HTML body part
      StringWriter sw = new StringWriter();
      PrintWriter pw = new PrintWriter(sw);
      pw.println("<html><head><title>Upload Notification</title></head><body><h1>Upload Notification</h1>");
      pw.println("<p>A number of files ("+count+") were uploaded to the atlas. Your approval is required.</p>");
      if( null != approvalPageLink ) {
        pw.println("<p>The page where uploaded files can be approved is located at: <a href=\""+approvalPageLink+"\">"+approvalPageLink+"</a></p>");
      }
      pw.println("</body></html>");
      pw.flush();
      message.setHtmlContent(sw.toString());
     
      // Send message
      mailDelivery.sendMessage(message);
     
    } catch (Exception e) {
View Full Code Here

        +" to "
        +recipients
        );
   
    try {
      MailMessage message = new MailMessage();
     
      // From
      message.setFromAddress(fromAddress);
     
      // To
      for(MailRecipient recipient : recipients){
        message.addToRecipient( recipient );
      }
     
      // Generate message
      Map<String,String> parameters = new HashMap<String,String>();
      parameters.put("submissionDocId", submissionDoc.optString("_id",null));
View Full Code Here

        +" to "
        +recipients
        );
   
    try {
      MailMessage message = new MailMessage();
     
      // From
      message.setFromAddress(fromAddress);
     
      // To
      for(MailRecipient recipient : recipients){
        message.addToRecipient( recipient );
      }
     
      // Generate message
      Map<String,String> parameters = new HashMap<String,String>();
      parameters.put("submissionDocId", submissionDoc.optString("_id",null));
View Full Code Here

   
    // Compute link
    String link = createUserUrl + "?token=" + token;
   
    try {
      MailMessage message = new MailMessage();
     
      // To
      for(MailRecipient recipient : recipients){
        message.addToRecipient( recipient );
      }
     
      // Subject
      message.setSubject("Nunaliit User Creation");
     
      // Create HTML body part
      StringWriter sw = new StringWriter();
      PrintWriter pw = new PrintWriter(sw);
      pw.println("<html><head><title>Nunaliit User Creation</title></head><body><h1>Nunaliit User Creation</h1>");
      pw.println("<p>Someone has requested to create a user for a Nunaliit Atlas. If it");
      pw.println("<p>was you, please follow the link below to complete the registration process.</p>");
      pw.println("<p>If you did not request a user to be created, simply disregard this e-mail.</p>");
      pw.println("<p>To complete the registration process, click on the link below, or paste");
      pw.println("it in your favourite web browser.</p>");
      pw.println("<p><a href=\""+link+"\">"+link+"</a></p>");
      pw.println("</body></html>");
      pw.flush();
      message.setHtmlContent(sw.toString());
     
      // Send message
      mailDelivery.sendMessage(message);
     
    } catch (Exception e) {
View Full Code Here

    }

    logger.info("Sending mail notification for "+docId+" to "+recipients);
   
    try {
      MailMessage message = new MailMessage();
     
      // From
      message.setFromAddress(fromAddress);
     
      // To
      for(MailRecipient recipient : recipients){
        message.addToRecipient( recipient );
      }
     
      // Generate message
      Map<String,String> parameters = new HashMap<String,String>();
      parameters.put("docId", docId);
View Full Code Here

    }

    logger.info("Sending daily vetter notification for "+count+" files to "+recipients);
   
    try {
      MailMessage message = new MailMessage();
     
      // From
      message.setFromAddress(fromAddress);
     
      // To
      for(MailRecipient recipient : recipients){
        message.addToRecipient( recipient );
      }
     
      // Generate message
      Map<String,String> parameters = new HashMap<String,String>();
      parameters.put("count", ""+count);
View Full Code Here

      String link = createUserUrl + "?token=" + urlEncodedToken;
      parameters.put("link", link);
    }
   
    try {
      MailMessage message = new MailMessage();
     
      // From
      message.setFromAddress(fromAddress);
     
      // To
      for(MailRecipient recipient : recipients){
        message.addToRecipient( recipient );
      }
     
      userCreationGenerator.generateMessage(message, parameters);
     
      // Send message
View Full Code Here

      String link = passwordRecoveryUrl + "?token=" + urlEncodedToken;
      parameters.put("link", link);
    }
   
    try {
      MailMessage message = new MailMessage();
     
      // From
      message.setFromAddress(fromAddress);
     
      // To
      for(MailRecipient recipient : recipients){
        message.addToRecipient( recipient );
      }

      passwordRecoveryGenerator.generateMessage(message, parameters);
     
      // Send message
View Full Code Here

    {
      parameters.put("password", password);
    }
   
    try {
      MailMessage message = new MailMessage();
     
      // From
      message.setFromAddress(fromAddress);
     
      // To
      for(MailRecipient recipient : recipients){
        message.addToRecipient( recipient );
      }
     
      passwordReminderGenerator.generateMessage(message, parameters);
     
      // Send message
View Full Code Here

TOP

Related Classes of ca.carleton.gcrc.mail.MailMessage

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.