Search in sources :

Example 31 with ContactList

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

the class CORunController method retrieveParticipantsFromGroups.

private ContactList retrieveParticipantsFromGroups(List<Long> groupKeys) {
    List<Identity> participiants = cgm.getParticipantsFromBusinessGroups(groupKeys);
    ContactList cl = new ContactList(translate("form.message.chckbx.partips"));
    cl.addAllIdentites(participiants);
    return cl;
}
Also used : ContactList(org.olat.core.util.mail.ContactList) Identity(org.olat.core.id.Identity)

Example 32 with ContactList

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

the class CORunController method retrieveParticipantsFromAreas.

private ContactList retrieveParticipantsFromAreas(List<Long> areaKeys) {
    List<Identity> participiants = cgm.getParticipantsFromAreas(areaKeys);
    ContactList cl = new ContactList(translate("form.message.chckbx.partips"));
    cl.addAllIdentites(participiants);
    return cl;
}
Also used : ContactList(org.olat.core.util.mail.ContactList) Identity(org.olat.core.id.Identity)

Example 33 with ContactList

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

the class CORunController method retrieveParticipantsFromCourse.

private ContactList retrieveParticipantsFromCourse() {
    List<Identity> participiants = cgm.getParticipants();
    ContactList cl = new ContactList(translate("form.message.chckbx.partips"));
    cl.addAllIdentites(participiants);
    return cl;
}
Also used : ContactList(org.olat.core.util.mail.ContactList) Identity(org.olat.core.id.Identity)

Example 34 with ContactList

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

the class CORunController method retrieveOwnersFromCourse.

private ContactList retrieveOwnersFromCourse() {
    ;
    List<Identity> ownerList = repositoryService.getMembers(cgm.getCourseEntry(), GroupRoles.owner.name());
    ContactList cl = new ContactList(translate("form.message.chckbx.owners"));
    cl.addAllIdentites(ownerList);
    return cl;
}
Also used : ContactList(org.olat.core.util.mail.ContactList) Identity(org.olat.core.id.Identity)

Example 35 with ContactList

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

the class InvitationEditRightsController method sendInvitation.

private void sendInvitation() {
    String inviteeEmail = invitee.getUser().getProperty(UserConstants.EMAIL, getLocale());
    ContactList contactList = new ContactList(inviteeEmail);
    contactList.add(inviteeEmail);
    boolean success = false;
    try {
        mailTemplate.setSubjectTemplate(subjectEl.getValue());
        mailTemplate.setBodyTemplate(bodyEl.getValue());
        MailContext context = new MailContextImpl(binder, null, getWindowControl().getBusinessControl().getAsString());
        MailBundle bundle = new MailBundle();
        bundle.setContext(context);
        bundle.setFromId(getIdentity());
        bundle.setContactList(contactList);
        bundle.setContent(subjectEl.getValue(), bodyEl.getValue());
        MailerResult result = mailManager.sendExternMessage(bundle, null, true);
        success = result.isSuccessful();
    } catch (Exception e) {
        logError("Error on sending invitation mail to contactlist, invalid address.", e);
    }
    if (success) {
        showInfo("invitation.mail.success");
    } else {
        showError("invitation.mail.failure");
    }
}
Also used : MailContextImpl(org.olat.core.util.mail.MailContextImpl) MailContext(org.olat.core.util.mail.MailContext) MailerResult(org.olat.core.util.mail.MailerResult) ContactList(org.olat.core.util.mail.ContactList) MailBundle(org.olat.core.util.mail.MailBundle)

Aggregations

ContactList (org.olat.core.util.mail.ContactList)92 Identity (org.olat.core.id.Identity)66 ContactMessage (org.olat.core.util.mail.ContactMessage)28 MailBundle (org.olat.core.util.mail.MailBundle)26 ContactFormController (org.olat.modules.co.ContactFormController)22 MailContextImpl (org.olat.core.util.mail.MailContextImpl)18 MailerResult (org.olat.core.util.mail.MailerResult)18 MailContext (org.olat.core.util.mail.MailContext)16 ArrayList (java.util.ArrayList)14 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)14 RepositoryEntry (org.olat.repository.RepositoryEntry)10 HashSet (java.util.HashSet)8 Test (org.junit.Test)8 BusinessGroup (org.olat.group.BusinessGroup)7 Locale (java.util.Locale)6 WindowControl (org.olat.core.gui.control.WindowControl)6 Translator (org.olat.core.gui.translator.Translator)6 File (java.io.File)4 Date (java.util.Date)4 Address (javax.mail.Address)4