Beispiel #1
0
 public function sendmailAction()
 {
     /* if response success */
     if ($this->type == 1) {
         $subject = isset($this->_params['subject']) ? $this->_params['subject'] : '';
         $template = isset($this->_params['template']) ? $this->_params['template'] : '';
         $email = isset($this->_params['email']) ? $this->_params['email'] : '';
         $p = isset($this->_params['p']) ? $this->_params['p'] : array();
         /** if no template */
         if (isNE($template)) {
             $this->type = 2;
             $this->response = array('data' => array(), 'message' => 'Please specify template', 'type' => $this->type);
             /** if no email */
         } elseif (isNE($email)) {
             $this->type = 2;
             $this->response = array('data' => array(), 'message' => 'Please specify email', 'type' => $this->type);
             /** Try SEND with htmlMailer */
         } else {
             $htmlMailer = new KM_HtmlMailer();
             $email_response = $htmlMailer->sendMail($subject, $template, $p, $email);
             /** Success */
             if (!is_null($email_response)) {
                 $this->type = 1;
                 $this->response = array('data' => array(), 'message' => 'Email succesfully send', 'type' => $this->type);
                 /** Fail */
             } else {
                 $this->type = 3;
                 $this->response = array('data' => array(), 'message' => "Something wen't wrong, check logme.log", 'type' => $this->type);
             }
         }
     }
 }
Beispiel #2
0
/**
 * Get resource from link
 * @param string $link
 * @return string
 */
function l($link = '')
{
    $config = Zend_Registry::get('__CONFIG__');
    $url = trim($config['api']['url'], 'api');
    return !isNE($link) ? $url . $link : '';
}
Beispiel #3
0
/**
 * Get the resource link
 * @param string $link
 * @return string
 */
function l($link = '')
{
    return !isNE($link) ? 'http://' . $_SERVER['HTTP_HOST'] . (isset($_SERVER['CONTEXT_PREFIX']) ? $_SERVER['CONTEXT_PREFIX'] : '/master') . '/' . $link : '';
}
Beispiel #4
0
 /**
  * Sets the limit
  * 
  * @param mixed $limit
  * @return Table_Abstract
  */
 public function setLimit($limit)
 {
     if (!isNE($limit)) {
         $this->limit = $limit;
     }
     return $this;
 }
Beispiel #5
0
 /**
  * @param string $subject
  * @param string $domain
  * @param string $template
  * @param array $p
  * @param string $email
  * @return bool|null
  */
 public function sendMail($subject = "", $template = "", $p = array(), $email = "")
 {
     if ($this->emailOption['send_mail'] == 1) {
         /** $subject */
         if (isNE($subject)) {
             $subject = $this->emailOption['subject'];
         }
         /** $template */
         if (!isNE($template)) {
             $template = APPLICATION_ENV . "/" . $template . ".phtml";
         }
         $this->sendOption = 1;
         $this->setSubject($subject);
         $this->addTo($email);
         $this->assign("p", $p);
         return $this->sendHtmlTemplate($template, Zend_Mime::ENCODING_8BIT);
     }
     return null;
 }