}
}
}
public void sendEmail(List<Reminds> reminds) {
ADDateTimeFormatter formatter = new ADDateTimeFormatter();
for (Reminds remind : reminds) {
Remind content = reminderService.findRemind(remind.getPid());
// 主旨
StringBuffer subject = new StringBuffer();
subject.append(CapAppContext.getMessage("remind.subject1"));
subject.append(formatter.reformat(content.getStartDate()));
subject.append(" ");
subject.append(CapAppContext.getMessage("remind.subject2"));
subject.append(CapString.isEmpty(content.getContent()) ? ""
: content.getContent().substring(
0,
content.getContent().length() > 40 ? 40 : content
.getContent().length()));
// 內文
StringBuffer sendContext = new StringBuffer();
sendContext.append(CapAppContext.getMessage("remind.startDate"));
sendContext.append(formatter.reformat(content.getStartDate()));
sendContext.append("<br/>");
sendContext.append(CapAppContext.getMessage("remind.endDate"));
sendContext.append(formatter.reformat(content.getEndDate()));
sendContext.append("<br/>");
sendContext.append(CapAppContext.getMessage("remind.subject2"));
sendContext.append(formatter.reformat(content.getContent()));
String email = reminderService.getUsrEmail(remind.getScopePid());
if (email != null) {
emailService.sendEmail(new String[] { email },
subject.toString(), sendContext.toString());