示例#1
0
 /**
  * sends a mail from an alert
  * @param Alert $alert
  */
 public function sendMailAlert(Alert $alert)
 {
     $this->sendMail($alert->getToMail(), $alert->getSubject(), $alert->getBody(), $alert->getFromF());
 }
示例#2
0
 /**
  * create a sms/mail alert
  * @param type $toSms
  * @param type $toMail
  * @param type $body
  * @param type $subject
  * @param type $from if null passed use default from configuration
  * @param type $date if null passed the alert is send instantely
  */
 public function createSmsMailAlert($toSms, $toMail, $body, $subject, $from = null, $date = null)
 {
     $alert = new Alert();
     $alert->setType(AlertType::SMS_MAIL);
     $alert->setBody($body);
     $alert->setFromF($from);
     $alert->setSent(false);
     $alert->setSubject($subject);
     $alert->setToSms($toSms);
     $alert->setToMail($toMail);
     $alert->setDate($date);
     if ($date == null) {
         $this->sendAlert($alert);
     } else {
         $this->em->persist($alert);
         $this->em->flush();
     }
 }