Package org.olat.core.util.mail

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


          body = userTrans.translate("pwchange.intro", new String[] { identity.getName() })
              + userTrans.translate("pwchange.body", new String[] { serverpath, tk.getRegistrationKey(),
                  I18nManager.getInstance().getLocaleKey(ureq.getLocale()) }) + SEPARATOR
              + userTrans.translate("reg.wherefrom", new String[] { serverpath, today, ip });
          subject = userTrans.translate("pwchange.subject");
          MailTemplate mailTempl = new MailTemplate(subject, body, null) {
            @Override
            public void putVariablesInMailContext(VelocityContext context, Identity recipient) {
              // nothing to do
            }
          };
View Full Code Here


        locale);
    String subject = trans.translate(subjectKey);
    String body = trans.translate(bodyKey, bodyArgs);

    // create a mail template which all these data
    MailTemplate mailTempl = new MailTemplate(subject, body, null) {
      @Override
      public void putVariablesInMailContext(VelocityContext context, Identity identity) {
        // Put user variables into velocity context
        User user = identity.getUser();
        context.put("firstname", user.getProperty(UserConstants.FIRSTNAME, null));
View Full Code Here

        // Participant and waiting-list were changed => reload both
        partipGrpCntrllr.reloadData();
        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 );   
View Full Code Here

      // configuration.
      ownerGrpCntrllr = new GroupController(ureq, getWindowControl(), true, requiresOwner, enableTablePreferences, currBusinessGroup
          .getOwnerGroup());
      listenTo(ownerGrpCntrllr);
      // add mail templates used when adding and removing users
      MailTemplate ownerAddUserMailTempl = BGMailHelper.createAddParticipantMailTemplate(currBusinessGroup, ureq.getIdentity());
      ownerGrpCntrllr.setAddUserMailTempl(ownerAddUserMailTempl);
      MailTemplate ownerAremoveUserMailTempl = BGMailHelper.createRemoveParticipantMailTemplate(currBusinessGroup, ureq.getIdentity());
      ownerGrpCntrllr.setRemoveUserMailTempl(ownerAremoveUserMailTempl);
      // expose to velocity
      tmp.put("ownerGrpMngmnt", ownerGrpCntrllr.getInitialComponent());
      tmp.contextPut("hasOwnerGrp", Boolean.TRUE);
    } else {
      tmp.contextPut("hasOwnerGrp", Boolean.FALSE);
    }
    // groupcontroller which allows to remove all members
    partipGrpCntrllr = new GroupController(ureq, getWindowControl(), true, false, enableTablePreferences, currBusinessGroup
        .getPartipiciantGroup());
    listenTo(partipGrpCntrllr);
    // add mail templates used when adding and removing users
    MailTemplate partAddUserMailTempl = BGMailHelper.createAddParticipantMailTemplate(currBusinessGroup, ureq.getIdentity());
    partipGrpCntrllr.setAddUserMailTempl(partAddUserMailTempl);
    MailTemplate partAremoveUserMailTempl = BGMailHelper.createRemoveParticipantMailTemplate(currBusinessGroup, ureq.getIdentity());
    partipGrpCntrllr.setRemoveUserMailTempl(partAremoveUserMailTempl);
    // expose to velocity
    tmp.put("partipGrpMngmnt", partipGrpCntrllr.getInitialComponent());
    tmp.contextPut("type", this.currBusinessGroup.getType())
   
    // Show waiting list only if enabled
    if (hasWaitingList) {
      // waitinglist-groupcontroller which allows to remove all members
      SecurityGroup waitingList = currBusinessGroup.getWaitingGroup();
      waitingGruppeController = new WaitingGroupController(ureq, getWindowControl(), true, false, enableTablePreferences, waitingList );
      listenTo(waitingGruppeController);

      // add mail templates used when adding and removing users
      MailTemplate waitAddUserMailTempl = BGMailHelper.createAddWaitinglistMailTemplate(currBusinessGroup, ureq.getIdentity());
      waitingGruppeController.setAddUserMailTempl(waitAddUserMailTempl);
      MailTemplate waitRemoveUserMailTempl = BGMailHelper.createRemoveWaitinglistMailTemplate(currBusinessGroup, ureq.getIdentity());
      waitingGruppeController.setRemoveUserMailTempl(waitRemoveUserMailTempl);
      MailTemplate waitTransferUserMailTempl = BGMailHelper.createWaitinglistTransferMailTemplate(currBusinessGroup, ureq.getIdentity());
      waitingGruppeController.setTransferUserMailTempl(waitTransferUserMailTempl);
      // expose to velocity
      tmp.put("waitingGrpMngmnt", waitingGruppeController.getInitialComponent());
      tmp.contextPut("hasWaitingGrp", Boolean.TRUE);
    } else {
View Full Code Here

    if (tdm.getObjects(tmse.getSelection()).size() != 0) {
      selectedIdentities = tdm.getObjects(tmse.getSelection());
      if (deleteUserMailCtr != null) {
        deleteUserMailCtr.dispose();
      }
      MailTemplate deleteMailTemplate = createMailTemplate(translate(KEY_EMAIL_SUBJECT), translate(KEY_EMAIL_BODY));
      deleteMailTemplate.addToContext("lastloginduration",   Integer.toString(UserDeletionManager.getInstance().getLastLoginDuration() ));
      deleteMailTemplate.addToContext("durationdeleteemail", Integer.toString(UserDeletionManager.getInstance().getDeleteEmailDuration() ));
      deleteUserMailCtr = new MailNotificationEditController(getWindowControl(), ureq, deleteMailTemplate, true);
     
      this.listenTo(deleteUserMailCtr);
      cmc = new CloseableModalController(getWindowControl(), translate("close"), deleteUserMailCtr.getInitialComponent());
      cmc.activate();
View Full Code Here

   * @param subject
   * @param body
   * @return
   */
  private MailTemplate createMailTemplate(String subject, String body) {   
    return new MailTemplate(subject, body, null) {
      @Override
      public void putVariablesInMailContext(VelocityContext context, Identity identity) {
        context.put("firstname", identity.getUser().getProperty(UserConstants.FIRSTNAME, null));
        context.put("lastname", identity.getUser().getProperty(UserConstants.LASTNAME, null));
        context.put("username", identity.getName());
View Full Code Here

   *
   * @param ureq
   */
  private void buildStep3(UserRequest ureq) {
    String courseTitle = "'" + repositoryEntry.getDisplayname() + "'";
    MailTemplate mailTempl = createMailTemplate(translator.translate("wizard.step3.mail.subject", new String[] { courseTitle }), translator
        .translate("wizard.step3.mail.body", new String[] {
            courseTitle,
            ureq.getIdentity().getUser().getProperty(UserConstants.FIRSTNAME, null) + " "
                + ureq.getIdentity().getUser().getProperty(UserConstants.LASTNAME, null) }));
    if(mailNotificationCtr != null) mailNotificationCtr.dispose();
View Full Code Here

   * @param subject
   * @param body
   * @return
   */
  private MailTemplate createMailTemplate(String subject, String body) {   
    return new MailTemplate(subject, body, null) {
      @Override
      public void putVariablesInMailContext(VelocityContext context, Identity identity) {
        // nothing to do
      }
    };
View Full Code Here

    addToRunContext("finish", finishV);
   
    @SuppressWarnings("unchecked")
    List<String[]> userproperties = (List<String[]>)getFromRunContext("userproperties");
   
    MailTemplate mailtemplate = createMailTemplate(userproperties, copiesV, colorV, pickupV, printV, finishV);
    addToRunContext("mailtemplate", mailtemplate);
    addToRunContext("replyto", replyto);
    // inform surrounding Step runner to proceed
    fireEvent(ureq, StepsEvent.ACTIVATE_NEXT);
View Full Code Here

  private MailTemplate createMailTemplate(final List<String[]> userprops, final String copiesV, final String colorV, final String pickupV, final String printV, final String finishV) {
    String subject = translate("email.subject");
    String body = translate("email.body");
    final Translator translator = getTranslator();
    MailTemplate mt = new MailTemplate(subject, body, null){
      private String mycopiesV = copiesV;
      private String mycolorV = colorV;
      private String myprintV = printV;
      private String myfinishV = finishV;
      private String mypickupV = pickupV;
View Full Code Here

TOP

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

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.