Examples of Emailer

  • org.olat.core.util.mail.Emailer
    Helper class for sending emails. All mails sent by this class will have a footer that includes a link to this OLAT installation Initial Date: Feb 10, 2005 @author Sabina Jeger
  • org.pentaho.platform.scheduler2.email.Emailer

  • Examples of hirondelle.web4j.webmaster.Emailer

          fLogger.fine("Sending email for password reset. Sending to : "  + user.getEmailAddress());
          String nonce = buildNonceFor(user);
          //technically should be done in a tx, but the likelihood of error is nearly zero.
          dao.setNewNonce(user, nonce);
         
          Emailer emailer = BuildImpl.forEmailer();
          List<String> toEndUser = new ArrayList<String>();
          toEndUser.add(user.getEmailAddress());
          emailer.sendFromWebmaster(toEndUser, buildEmailSubject(user), buildEmailBody(user, nonce));
          addMessage("An email has been sent to that email address. The email contains a special link to let you reset your password.");
        }
      }
    View Full Code Here

    Examples of org.jboss.soa.esb.actions.routing.email.Emailer

       * @throws ConfigurationException
       * @see NotifyEmail#sendNotification(Message)
       */
      public NotifyEmail (ConfigTree configTree) throws ConfigurationException
      {
          this(configTree, new Emailer(configTree));
      } // __________________________________
    View Full Code Here

    Examples of org.olat.core.util.mail.Emailer

        try {
                IdentityManager im = (IdentityManager)CoreSpringFactory.getBean("core.id.IdentityManager");
          Identity ident = im.findIdentityByName(username);
          //if null, user may crashed befor getting a valid session, try with guest user instead
          if (ident == null) ident = im.findIdentityByName("guest");
          Emailer emailer = new Emailer(ident, true);
          LogFile lf = new LogFile();
          Date d = new Date();
          SimpleDateFormat year = new SimpleDateFormat("yyyy");
          SimpleDateFormat month = new SimpleDateFormat("MM");
          SimpleDateFormat day = new SimpleDateFormat("dd");
          String errorNum = parseErrorNumber(errorNr);
          Collection logFileEntries = lf.getError(errorNum, day.format(d), month.format(d), year.format(d), false);
          StringBuilder out = new StringBuilder();
          if (logFileEntries != null) {
            for (Iterator iter = logFileEntries.iterator(); iter.hasNext();) {
              out.append((String) iter.next());
            }
          }
          emailer.sendEmail(WebappHelper.getMailConfig("mailSupport"), "Feedback from Error Nr.: " + errorNr, request.getParameter("textarea")
              + "\n------------------------------------------\n\n --- from user: "+username+" ---" + out.toString());
        } catch (AddressException e) {
          // error in recipient email address(es)
          handleException(request, e);
          return;
    View Full Code Here

    Examples of org.olat.core.util.mail.Emailer

       */
      public void event(UserRequest ureq, Component source, Event event) {
        if (source == cntctForm) {
          if (event == Form.EVNT_VALIDATION_OK) {
            boolean useInstitutionalEmail = false;
            Emailer emailer = new Emailer(emailFrom, useInstitutionalEmail);
            //
            boolean success = false;
            try {
              if(cntctForm.getCheckBoxElement("tcpfrom").isChecked()) {
                ContactList contactList = new ContactList(translate("contact.list.sender"));
                contactList.add(emailFrom);                                            
                 cntctForm.addEmailTo(contactList);
              }
              success = emailer.sendEmail(cntctForm.getEmailToContactLists(), cntctForm.getSubject(), cntctForm.getBody());
            } catch (AddressException e) {
              //error in recipient email address(es)
              handleAddressException(success);
              //no return here, depending on boolean success there are
              //events to fire
    View Full Code Here

    Examples of org.olat.core.util.mail.Emailer

        cl.add(WebappHelper.getMailConfig("mailSupport"));
        cl.add(ureq.getIdentity());
        List<ContactList> lstAddrTO = new ArrayList<ContactList>();
        lstAddrTO.add(cl);
       
        Emailer mailer = new Emailer(ureq.getLocale());
        try {
          mailer.sendEmail(lstAddrTO, subject, body);
        } catch (AddressException e) {
          Tracing.createLoggerFor(BulkDeleteController.class).error("Notificatoin mail for bulk deletion could not be sent");
        } catch (MessagingException e) {
          Tracing.createLoggerFor(BulkDeleteController.class).error("Notificatoin mail for bulk deletion could not be sent");
        }
    View Full Code Here

    Examples of org.olat.core.util.mail.Emailer

        String ip = ureq.getHttpReq().getRemoteAddr();
        String today = DateFormat.getDateInstance(DateFormat.LONG, ureq.getLocale()).format(new Date());
        // mailer configuration
        String serverpath = Settings.getServerContextPathURI();
        String servername = ureq.getHttpReq().getServerName();
        Emailer mailer = new Emailer(ureq.getLocale());
        Tracing.createLoggerFor(ProfileAndHomePageEditController.class).debug("this servername is " + servername + " and serverpath is " + serverpath);
        // load or create temporary key
        HashMap<String, String> mailMap = new HashMap<String, String>();
        mailMap.put("currentEMail", currentEmail);
        mailMap.put("changedEMail", changedEmail);
       
        XStream xml = new XStream();
        String serMailMap = xml.toXML(mailMap);
       
        TemporaryKey tk = loadCleanTemporaryKey(serMailMap);       
        if (tk == null) {
          tk = rm.createTemporaryKeyByEmail(serMailMap, ip, RegistrationManager.EMAIL_CHANGE);
        } else {
          rm.deleteTemporaryKeyWithId(tk.getRegistrationKey());
          tk = rm.createTemporaryKeyByEmail(serMailMap, ip, RegistrationManager.EMAIL_CHANGE);
        }
       
        // create date, time string
        Calendar cal = Calendar.getInstance();
        cal.setTime(tk.getCreationDate());
        cal.add(Calendar.DAY_OF_WEEK, ChangeEMailController.TIME_OUT);
        String time = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, ureq.getLocale()).format(cal.getTime());
        // create body and subject for email
        body = this.translator.translate("email.change.body", new String[] { serverpath + "/dmz/emchange/index.html?key=" + tk.getRegistrationKey() + "&lang=" + ureq.getLocale().getLanguage(), time })
            + SEPARATOR + this.translator.translate("email.change.wherefrom", new String[] { serverpath, today, ip });
        subject = translate("email.change.subject");
        // send email
        try {
          boolean isMailSent = mailer.sendEmail(changedEmail, subject, body);
          if (isMailSent) {
            tk.setMailSent(true);
            // set key
            User user = this.identityToModify.getUser();
            user.setProperty("emchangeKey", tk.getRegistrationKey());
    View Full Code Here

    Examples of org.olat.core.util.mail.Emailer

        if (locale == null) {
          locale = I18nManager.getInstance().getCurrentThreadLocale();
        }
        Translator translator = new PackageTranslator(this.getClass().getPackage().getName(), locale);
       
        Emailer emailer = new Emailer(locale);
        String subject = translator.translate(emailI18nSubkey+".subject");
        String body = translator.translate(emailI18nSubkey+".body");
        try {
          emailer.sendEmail(email, subject, body);
        } catch (AddressException e) {
          log_.error("Error sending information email to user that file was saved successfully.", e);
        } catch (SendFailedException e) {
          log_.error("Error sending information email to user that file was saved successfully.", e);
        } catch (MessagingException e) {
    View Full Code Here

    Examples of org.olat.core.util.mail.Emailer

            User user = UserManager.getInstance().findUserByEmail(email);
            // get remote address
            String ip = ureq.getHttpReq().getRemoteAddr();
            String body = null;
            String today = DateFormat.getDateInstance(DateFormat.LONG, ureq.getLocale()).format(new Date());
            Emailer mailer = new Emailer(ureq.getLocale());
            //TODO eMail Vorlagen
            String serverpath = Settings.getServerContextPathURI();
            boolean isMailSent = false;
            if (user == null) {
              TemporaryKey tk = rm.loadTemporaryKeyByEmail(email);
              if (tk == null) tk = rm.createTemporaryKeyByEmail(email, ip, rm.REGISTRATION);
              myContent.contextPut("regKey", tk.getRegistrationKey());
              body = getTranslator().translate("reg.body",
                  new String[] { serverpath, tk.getRegistrationKey(), I18nManager.getInstance().getLocaleKey(ureq.getLocale()) })
                  + SEPARATOR
                  + getTranslator().translate("reg.wherefrom", new String [] { serverpath, today, ip });
              try {
                if (mailer.sendEmail(email, translate("reg.subject"), body)) isMailSent = true;
              } catch (Exception e) {
                // nothing to do, emailSent flag is false, errors will be reported to user
              }
            } else {
              // a user exists, this is an error in the registration page
              // send email
              Identity identity = UserManager.getInstance().findIdentityByEmail(email);
              body = translate("login.body", identity.getName()) + SEPARATOR
                  + getTranslator().translate("reg.wherefrom", new String[] { serverpath, today, ip });
              try {
                isMailSent = mailer.sendEmail(email, translate("login.subject"), body);
              } catch (Exception e) {
                // nothing to do, emailSent flag is false, errors will be reported to user
              }
            }
            if (isMailSent) {
    View Full Code Here

    Examples of org.pentaho.platform.scheduler2.email.Emailer

          // send email
          SimpleRepositoryFileData data =
              repo.getDataForRead( sourceFile.getId(), SimpleRepositoryFileData.class );     
         
          // if email is setup and we have tos, then do it
          Emailer emailer = new Emailer();
          if ( !emailer.setup() ) {
            // email not configured
            return;
          }
          String to = (String) actionParams.get( "_SCH_EMAIL_TO" );
          String cc = (String) actionParams.get( "_SCH_EMAIL_CC" );
          String bcc = (String) actionParams.get( "_SCH_EMAIL_BCC" );
          if ( ( to == null || "".equals( to ) ) && ( cc == null || "".equals( cc ) )
              && ( bcc == null || "".equals( bcc ) ) ) {
            // no destination
            return;
          }
          emailer.setTo( to );
          emailer.setCc( cc );
          emailer.setBcc( bcc );
          emailer.setAttachment( data.getInputStream() );
          emailer.setAttachmentName( "attachment" );
          String attachmentName = (String) actionParams.get( "_SCH_EMAIL_ATTACHMENT_NAME" );
          if ( attachmentName != null && !"".equals( attachmentName ) ) {
            String path = filePath;
            if ( path.endsWith( ".*" ) ) {
              path = path.replace( ".*", "" );
            }
            String extension = MimeHelper.getExtension( data.getMimeType() );
            if ( extension == null ) {
              extension = ".bin";
            }
            if ( !attachmentName.endsWith( extension ) ) {
              emailer.setAttachmentName( attachmentName + extension );
            } else {
              emailer.setAttachmentName( attachmentName );
            }
          } else if ( data != null ) {
            String path = filePath;
            if ( path.endsWith( ".*" ) ) {
              path = path.replace( ".*", "" );
            }
            String extension = MimeHelper.getExtension( data.getMimeType() );
            if ( extension == null ) {
              extension = ".bin";
            }
            path = path.substring( path.lastIndexOf( "/" ) + 1, path.length() );
            if ( !path.endsWith( extension ) ) {
              emailer.setAttachmentName( path + extension );
            } else {
              emailer.setAttachmentName( path );
            }
          }
          if ( data == null || data.getMimeType() == null || "".equals( data.getMimeType() ) ) {
            emailer.setAttachmentMimeType( "binary/octet-stream" );
          } else {
            emailer.setAttachmentMimeType( data.getMimeType() );
          }
          String subject = (String) actionParams.get( "_SCH_EMAIL_SUBJECT" );
          if ( subject != null && !"".equals( subject ) ) {
            emailer.setSubject( subject );
          } else {
            emailer.setSubject( "Pentaho Scheduler: " + emailer.getAttachmentName() );
          }
          String message = (String) actionParams.get( "_SCH_EMAIL_MESSAGE" );
          if ( subject != null && !"".equals( subject ) ) {
            emailer.setBody( message );
          }
          emailer.send();
        } catch ( Exception e ) {
          log.warn( e.getMessage(), e );
        }     
      }
    View Full Code Here
    TOP
    Copyright © 2018 www.massapi.com. 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.