Example #1
0
 /**
  * {@inheritdoc}
  */
 public function send($template, array $recipients, array $data = array())
 {
     $data = $this->twig->mergeGlobals($data);
     $template = $this->twig->loadTemplate($template);
     $content = $template->renderBlock('content', $data);
     $originator = $template->renderBlock('originator', $data);
     $this->sender->send($recipients[0], $content, $originator);
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function flush(SmsSenderInterface $sender)
 {
     $results = array();
     $errors = array();
     foreach ($this->messages as $message) {
         try {
             $results[] = $sender->send($message['recipient'], $message['body'], $message['originator']);
         } catch (Exception $e) {
             $errors[] = $e;
         }
     }
     return array($results, $errors);
 }
 /**
  * @return null|string
  */
 protected function getProviderClass()
 {
     return ($provider = $this->sender->getProvider()) ? get_class($provider) : null;
 }