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;
}
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;
}
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;
}
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;
}
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");
}
}
Aggregations