// send alarm trip notification with image attachment when initiated by remote device
if (ServiceProvider.IMPL.getEmailService().isConnected() &&
event.isFromRemote() &&
getActor().getHost().getMailRecipients() != null &&
!getActor().getHost().getMailRecipients().isEmpty()) {
final ImageCapture imgc = (ImageCapture) event.getNewValue();
String[] mrs = new String[getActor().getHost().getMailRecipients().size()];
int i = -1;
for (final MailRecipient mr : getActor().getHost().getMailRecipients()) {
mrs[++i] = mr.getEmail();
}
ServiceProvider.IMPL.getEmailService().send(
RS.rbLabel(KEY.MAIL_ALARM_NOFITY_SUBJECT, imgc
.getRemoteNode().getAddress()),
RS.rbLabel(KEY.MAIL_ALARM_NOFITY_SUBJECT, imgc
.getRemoteNode().getMultiAlarmTripState(), imgc
.getRemoteNode().getAddress()),
getActor().getHost().getMailUserName(), mrs,
imgc.getFilePath());
RS.mediaPlayerComplete.play();
if (log.isInfoEnabled()) {
log.info(String.format("Alarm image notification(s) sent to %1$s", mrs.toString()));
}
}