Exemplo n.º 1
0
 /**
  * @param MessageInterface $message
  * @param RecipientInterface $recipient
  * @return mixed|void
  */
 protected function send(MessageInterface $message, RecipientInterface $recipient)
 {
     $pushoverMessage = new Message($this->token, $recipient->getInfo('pushover.user_key'));
     $pushoverMessage->setMessage($message->getSubject(), $message->getContent());
     $pushoverMessage->setPriority(0, 60, 120);
     $pushoverMessage->send();
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 protected function send(MessageInterface $message, RecipientInterface $recipient)
 {
     $mail = clone $this->message;
     $mail->setTo($recipient->getInfo('email'));
     $mail->setSubject($message->getSubject());
     $mail->setBody($message->getContent(), 'text/html');
     $this->mailer->send($mail);
 }
Exemplo n.º 3
0
 private function sendStomp(MessageInterface $message, RecipientInterface $recipient)
 {
     $stomp = $this->connectSTOMP();
     if ($stomp) {
         $frame = new Frame('SEND', $this->stompheaders, $message->getContent());
         $res = $stomp->send('/queue/' . $this->stompdestination, $frame, array(), true);
         return $res;
     } else {
         return false;
     }
 }
Exemplo n.º 4
0
 protected function send(MessageInterface $message, RecipientInterface $recipient)
 {
     $oProwl = new Connector();
     $oMsg = new Message();
     try {
         $oProwl->setIsPostRequest(true);
         $oMsg->setPriority(0);
         $oProwl->setFilterCallback(function ($sText) {
             return $sText;
         });
         $oMsg->addApiKey($recipient->getInfo('prowl_app.api_key'));
         $oMsg->setEvent($message->getSubject());
         $oMsg->setDescription($message->getContent());
         $oMsg->setApplication($this->appName);
         $oResponse = $oProwl->push($oMsg);
         if ($oResponse->isError()) {
             $this->errors[] = $oResponse->getErrorAsString();
         }
     } catch (\InvalidArgumentException $oIAE) {
         $this->errors[] = $oIAE->getMessage();
     } catch (\OutOfRangeException $oOORE) {
         $this->errors[] = $oOORE->getMessage();
     }
 }
Exemplo n.º 5
0
 /**
  * {@inheritDocs}
  */
 protected function send(MessageInterface $message, RecipientInterface $recipient)
 {
     $to = $recipient;
     $headers = implode("\r\n", $this->headers);
     mail($to, $message->getSubject(), $message->getContent(), $headers);
 }