public function raise($alias, $recipients, $params = array()) { $handler = new $this->handlerClass($this->handlerParams); $handler->init(); $smsTemplate = new SmsView($params); $content = $smsTemplate->fetch($alias); return $handler->send($recipients, $content, $this->phoneSender); }
public function run() { $v = new SmsView(); if (!empty($_REQUEST['number']) && !empty($_REQUEST['message'])) { $tw = new TwilioSms(); $number = preg_replace('/[^0-9]/', '', $_REQUEST['number']); $tw->addNumber($number); $tw->send(htmlentities($_REQUEST['message']), $this->userid); $v->setMsg('Message sent to ' . htmlentities($_REQUEST['number'])); } $v->run(); }
public function raise($alias, $recipients, $params = array()) { $event = Manager::getInstance()->getMapper('SmsTemplateMapper')->findFirst(array('Criteria' => array('IsActive' => true, 'Alias' => $alias))); if ($event->getId()) { $sms = Manager::getInstance()->getMapper('SmsProviderMapper')->findFirst(array('Criteria' => array('IsActive' => true))); if ($sms->getId()) { $classname = 'Sms' . $sms->getHandler(); $handler = new $classname(); $handler->init(); $smsTemplate = new SmsView($params); $content = $smsTemplate->fetch($event->getAlias()); return $handler->send($recipients, $content, Manager::getInstance()->getModule('Main')->config('AdminPhoneSender')); } } return false; }