Package org.olat.core.util.mail

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


            public void putVariablesInMailContext(VelocityContext context, Identity recipient) {
              // nothing to do
            }
          };
           
          MailerResult result = MailerWithTemplate.getInstance().sendMail(identity, null, null, mailTempl, null);
          if(result.getReturnCode() == 0) {
            getWindowControl().setInfo(translate("email.sent"));
            // prepare next step
            wic.setCurStep(2);
            myContent.contextPut("text", translate("step2.pw.text"));
            emailOrUsernameCtr.getInitialComponent().setVisible(false);
View Full Code Here


        waitingGruppeController.reloadData();
        // send mail for all of them
        MailerWithTemplate mailer = MailerWithTemplate.getInstance();
        MailTemplate mailTemplate = identitiesMoveEvent.getMailTemplate();
        if (mailTemplate != null) {
          MailerResult mailerResult = mailer.sendMailAsSeparateMails(identitiesMoveEvent.getMovedIdentities(), null, null, mailTemplate, null);
          MailHelper.printErrorsAndWarnings(mailerResult, getWindowControl(), ureq.getLocale());
        }
        fireEvent(ureq, Event.CHANGED_EVENT );   
      }
    } else if (source == this.modifyBusinessGroupController) {
View Full Code Here

        if(template.getCpfrom()) {
          ccIdentities.add(sender);
        } else {
          ccIdentities = null
        }
        MailerResult mailerResult = mailer.sendMailUsingTemplateContext(identity, ccIdentities, null, template, sender);
        if (mailerResult.getReturnCode() != MailerResult.OK) {
          buf.append(pT.translate("email.error.send.failed", new String[] {identity.getUser().getProperty(UserConstants.EMAIL, null), identity.getName()} )).append("\n");
        }
        Tracing.logAudit("User-Deletion: Delete-email send to identity=" + identity.getName() + " with email=" + identity.getUser().getProperty(UserConstants.EMAIL, null), this.getClass());
        markSendEmailEvent(identity);
      }
View Full Code Here

        if (mailNotificationCtr.getMailTemplate().getCpfrom()) {
          ccIdentities.add(ureq.getIdentity());
        } else {
          ccIdentities = null;
        }
        MailerResult mailerResult = MailerWithTemplate.getInstance().sendMailAsSeparateMails(ownerList, ccIdentities, null,
            mailNotificationCtr.getMailTemplate(), ureq.getIdentity());
        StringBuilder errorMessage = new StringBuilder();
        StringBuilder warningMessage = new StringBuilder();
        MailHelper.appendErrorsAndWarnings(mailerResult, errorMessage, warningMessage, ureq.getLocale());
        if (warningMessage.length() > 0) getWindowControl().setWarning(warningMessage.toString());
View Full Code Here

            public void putVariablesInMailContext(VelocityContext context, Identity recipient) {
              // nothing to do
            }
          };
           
          MailerResult result = MailerWithTemplate.getInstance().sendMail(student, null, null, mailTempl, null);
         
          if(result.getReturnCode() > 0) {
            am.appendToUserNodeLog(node, coach, student, "MAIL SEND FAILED TO:" + toMail + "; MailReturnCode: " + result.getReturnCode());
            log.warn("Could not send email 'returnbox notification' to " + student + "with email=" + toMail);
          } else {
            log.info("Send email 'returnbox notification' to " + student + "with email=" + toMail);
          }
        }
View Full Code Here

      if(mailTemplate.getCpfrom()) {
        ccIdentities.add(sender);
      } else {
        ccIdentities = null
      }
      MailerResult mailerResult = mailer.sendMailAsSeparateMails(toBeRemoved, ccIdentities, null, mailTemplate, sender);
      MailHelper.printErrorsAndWarnings(mailerResult, getWindowControl(), ureq.getLocale());
    }
  }
View Full Code Here

      if(mailTemplate.getCpfrom()) {
        ccIdentities.add(sender);
      } else {
        ccIdentities = null
      }
      MailerResult mailerResult = mailer.sendMailAsSeparateMails(identitiesAddedEvent.getAddedIdentities(), ccIdentities, null, mailTemplate, sender);
      MailHelper.appendErrorsAndWarnings(mailerResult, errorMessage, infoMessage, ureq.getLocale());
    }
    // report any errors on screen
    if (infoMessage.length() > 0) getWindowControl().setWarning(infoMessage.toString());
    if (errorMessage.length() > 0) getWindowControl().setError(errorMessage.toString());
View Full Code Here

        public Step execute(UserRequest ureq2, WindowControl control, StepsRunContext runContext) {
          MailTemplate mailtemplate = (MailTemplate)runContext.get("mailtemplate");
          //fetch data from runContext and send eMail with it
          MailerWithTemplate mailer = MailerWithTemplate.getInstance();
          Identity replyto = (Identity)runContext.get("replyto");
          MailerResult mr = mailer.sendMail(ureq2.getIdentity(), null, null, mailtemplate, replyto);
          logAudit("DRUCKEREI-TEMPLATE-ERSTELLT", null);
          if(mr.getReturnCode() == MailerResult.OK){
            return StepsMainRunController.DONE_UNCHANGED;
          }else{
            return Step.NOSTEP;
          }
        }
View Full Code Here

    deleteBusinessGroup(businessGroupTodelete);
    // finally send email
    MailerWithTemplate mailer = MailerWithTemplate.getInstance();
    MailTemplate mailTemplate = BGMailHelper.createDeleteGroupMailTemplate(businessGroupTodelete, ureq.getIdentity());
    if (mailTemplate != null) {
      MailerResult mailerResult = mailer.sendMailAsSeparateMails(users, null, null, mailTemplate, null);
      MailHelper.printErrorsAndWarnings(mailerResult, wControl, ureq.getLocale());
    }
   
  }
View Full Code Here

            }
            // send a notification mail if available
            MailTemplate mailTemplate = BGMailHelper.createWaitinglistTransferMailTemplate(group, ureqIdentity);
            if (mailTemplate != null) {
              MailerWithTemplate mailer = MailerWithTemplate.getInstance();
              MailerResult mailerResult = mailer.sendMail(firstWaitingListIdentity, null, null, mailTemplate, null);
              // Does not report errors to current screen because this is the identity who triggered the transfer
              Tracing.logWarn("Could not send WaitinglistTransferMail for identity=" + firstWaitingListIdentity.getName() , BusinessGroupManagerImpl.class);
            }           
            transferNotDone = false;
          }
View Full Code Here

TOP

Related Classes of org.olat.core.util.mail.MailerResult

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.