}
final String content = getICal(event, type);
final Mail msg = new Mail();
msg.setProjectForgeSubject(composeSubject(event, type));
msg.setContentType(Mail.CONTENTTYPE_HTML);
final SendMail sendMail = new SendMail();
sendMail.setConfigXml(ConfigXml.getInstance());
for (final TeamEventAttendeeDO attendee : event.getAttendees()) {
msg.setContent(composeHtmlContent(event, attendee.getNumber(), type, marker));
if (attendee.getUserId() == null) {
msg.setTo(attendee.getUrl());
} else {
msg.setTo(attendee.getUser());
if (attendee.getUser().equals(PFUserContext.getUser()) == true) {
continue;
}
}
switch (type) {
case INVITATION:
if (sendMail.send(msg, content, event.getAttachments()) == false) {
failures++;
}
break;
case UPDATE:
case REJECTION:
if (sendMail.send(msg, content, null) == false) {
failures++;
}
break;
}