/**
* Sends an email
* @param array $users
* @param Element\Note $note
*/
public static function sendEmailNotification($users, $note)
{
//try {
$recipients = self::getNotificationUsers($users);
if (!count($recipients)) {
return;
}
$mail = new \Pimcore\Mail();
foreach ($recipients as $user) {
/**
* @var $user User
*/
$mail->addTo($user->getEmail(), $user->getName());
}
$element = Element\Service::getElementById($note->getCtype(), $note->getCid());
$mail->setSubject("[pimcore] {$note->getTitle()}, {$element->getType()} [{$element->getId()}]");
//TODO decide some body text/html
$mail->setBodyText($note->getDescription());
$mail->send();
//} catch(\Exception $e) {
// //todo application log
// }
}