Example #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();
 }
Example #2
0
 public function Run($input)
 {
     $token = $this->resolveParameter('token', $input);
     $userkey = $this->resolveParameter('userkey', $input);
     $message = $this->resolveParameter('message', $input);
     echo "\n### SendMessageAction: " . $message . "\n";
     $message = new Message($token, $userkey, $message);
     $message->send();
 }
Example #3
0
 /**
  * Test sending an actual message with wrong settings.
  */
 function testSendFailedMessage()
 {
     $message = new Message($this->config['pushover']['token'] . 'brokentoken', $this->config['pushover']['user_key'], $this->config['pushover']['message']);
     $message->setPriority(2, 60, 3600);
     $message->setUrl('http://www.linkorb.com/news', 'Cool blog');
     $this->assertFalse($message->send());
 }