Search in sources :

Example 11 with ContactMessage

use of org.olat.core.util.mail.ContactMessage in project OpenOLAT by OpenOLAT.

the class MembersTableController method doSendEmailToMember.

private void doSendEmailToMember(ContactList contactList, UserRequest ureq) {
    if (contactList.getEmailsAsStrings().size() > 0) {
        removeAsListenerAndDispose(cmc);
        removeAsListenerAndDispose(emailController);
        ContactMessage cmsg = new ContactMessage(ureq.getIdentity());
        cmsg.addEmailTo(contactList);
        // preset body template from i18n
        cmsg.setBodyText(createBodyTemplate());
        emailController = new ContactFormController(ureq, getWindowControl(), true, false, false, cmsg);
        listenTo(emailController);
        String title = translate("members.email.title");
        cmc = new CloseableModalController(getWindowControl(), translate("close"), emailController.getInitialComponent(), true, title);
        listenTo(cmc);
        cmc.activate();
    }
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) ContactFormController(org.olat.modules.co.ContactFormController) ContactMessage(org.olat.core.util.mail.ContactMessage)

Example 12 with ContactMessage

use of org.olat.core.util.mail.ContactMessage in project OpenOLAT by OpenOLAT.

the class MembersAvatarDisplayRunController method doSendEmailToMember.

private void doSendEmailToMember(ContactList contactList, UserRequest ureq) {
    if (contactList.hasAddresses()) {
        removeAsListenerAndDispose(cmc);
        removeAsListenerAndDispose(emailController);
        ContactMessage cmsg = new ContactMessage(ureq.getIdentity());
        cmsg.addEmailTo(contactList);
        // preset body template from i18n
        cmsg.setBodyText(createBodyTemplate());
        emailController = new ContactFormController(ureq, getWindowControl(), true, false, false, cmsg);
        listenTo(emailController);
        String title = translate("members.email.title");
        cmc = new CloseableModalController(getWindowControl(), translate("close"), emailController.getInitialComponent(), true, title);
        listenTo(cmc);
        cmc.activate();
    }
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) ContactFormController(org.olat.modules.co.ContactFormController) ContactMessage(org.olat.core.util.mail.ContactMessage)

Example 13 with ContactMessage

use of org.olat.core.util.mail.ContactMessage in project openolat by klemens.

the class UserInfoMainController method doOpenContact.

private ContactFormController doOpenContact(UserRequest ureq) {
    removeAsListenerAndDispose(contactFormController);
    ContactMessage cmsg = new ContactMessage(ureq.getIdentity());
    ContactList emailList = new ContactList(firstLastName);
    emailList.add(chosenIdentity);
    cmsg.addEmailTo(emailList);
    OLATResourceable ores = OresHelper.createOLATResourceableType(CMD_CONTACT);
    WindowControl bwControl = addToHistory(ureq, ores, null);
    contactFormController = new ContactFormController(ureq, bwControl, true, false, false, cmsg);
    listenTo(contactFormController);
    return contactFormController;
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) ContactFormController(org.olat.modules.co.ContactFormController) ContactList(org.olat.core.util.mail.ContactList) WindowControl(org.olat.core.gui.control.WindowControl) ContactMessage(org.olat.core.util.mail.ContactMessage)

Example 14 with ContactMessage

use of org.olat.core.util.mail.ContactMessage in project openolat by klemens.

the class StudentCoursesController method contact.

private void contact(UserRequest ureq) {
    removeAsListenerAndDispose(cmc);
    ContactMessage cmsg = new ContactMessage(getIdentity());
    ContactList contactList = new ContactList("to");
    contactList.add(student);
    cmsg.addEmailTo(contactList);
    contactCtrl = new ContactFormController(ureq, getWindowControl(), true, false, false, cmsg);
    listenTo(contactCtrl);
    cmc = new CloseableModalController(getWindowControl(), translate("close"), contactCtrl.getInitialComponent());
    cmc.activate();
    listenTo(cmc);
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) ContactFormController(org.olat.modules.co.ContactFormController) ContactList(org.olat.core.util.mail.ContactList) ContactMessage(org.olat.core.util.mail.ContactMessage)

Example 15 with ContactMessage

use of org.olat.core.util.mail.ContactMessage in project openolat by klemens.

the class ParticipantLectureBlocksController method doAppeal.

private void doAppeal(UserRequest ureq, LectureBlockAndRollCall row) {
    if (appealCtrl != null)
        return;
    LectureBlock block = lectureService.getLectureBlock(row.getLectureBlockRef());
    List<Identity> teachers = lectureService.getTeachers(block);
    List<Identity> onwers = repositoryService.getMembers(entry, GroupRoles.owner.name());
    ContactList contactList = new ContactList(translate("appeal.contact.list"));
    contactList.addAllIdentites(teachers);
    contactList.addAllIdentites(onwers);
    StringBuilder teacherNames = new StringBuilder();
    for (Identity teacher : teachers) {
        if (teacherNames.length() > 0)
            teacherNames.append(", ");
        teacherNames.append(teacher.getUser().getFirstName()).append(" ").append(teacher.getUser().getLastName());
    }
    String date = Formatter.getInstance(getLocale()).formatDate(block.getStartDate());
    String[] args = new String[] { row.getLectureBlockTitle(), teacherNames.toString(), date };
    ContactMessage cmsg = new ContactMessage(getIdentity());
    cmsg.addEmailTo(contactList);
    cmsg.setSubject(translate("appeal.subject", args));
    cmsg.setBodyText(translate("appeal.body", args));
    appealCtrl = new ContactFormController(ureq, getWindowControl(), true, false, false, cmsg);
    appealCtrl.setUserObject(row);
    appealCtrl.setContactFormTitle(translate("new.appeal.title"));
    listenTo(appealCtrl);
    String title = translate("appeal.title", new String[] { row.getLectureBlockTitle() });
    cmc = new CloseableModalController(getWindowControl(), "close", appealCtrl.getInitialComponent(), true, title);
    listenTo(cmc);
    cmc.activate();
}
Also used : LectureBlock(org.olat.modules.lecture.LectureBlock) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) ContactFormController(org.olat.modules.co.ContactFormController) ContactList(org.olat.core.util.mail.ContactList) Identity(org.olat.core.id.Identity) ContactMessage(org.olat.core.util.mail.ContactMessage)

Aggregations

ContactMessage (org.olat.core.util.mail.ContactMessage)34 ContactList (org.olat.core.util.mail.ContactList)28 ContactFormController (org.olat.modules.co.ContactFormController)28 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)20 Identity (org.olat.core.id.Identity)18 ArrayList (java.util.ArrayList)6 WindowControl (org.olat.core.gui.control.WindowControl)6 VelocityContainer (org.olat.core.gui.components.velocity.VelocityContainer)4 OLATResourceable (org.olat.core.id.OLATResourceable)4 HashMap (java.util.HashMap)2 List (java.util.List)2 UserBulkChangeStep00 (org.olat.admin.user.bulkChange.UserBulkChangeStep00)2 SecurityGroup (org.olat.basesecurity.SecurityGroup)2 SingleIdentityChosenEvent (org.olat.basesecurity.events.SingleIdentityChosenEvent)2 CollaborationTools (org.olat.collaboration.CollaborationTools)2 UserRequest (org.olat.core.gui.UserRequest)2 TableEvent (org.olat.core.gui.components.table.TableEvent)2 TableMultiSelectEvent (org.olat.core.gui.components.table.TableMultiSelectEvent)2 ControllerCreator (org.olat.core.gui.control.creator.ControllerCreator)2 PopupBrowserWindow (org.olat.core.gui.control.generic.popup.PopupBrowserWindow)2