fixed email ordering
This commit is contained in:
parent
77eaccdcc8
commit
a7542fe3f5
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/php
|
#!/usr/local/bin/php
|
||||||
<?php
|
<?php
|
||||||
error_reporting(E_ALL ^ E_NOTICE);
|
error_reporting(E_ERROR | E_PARSE);
|
||||||
ini_set('display_errors',true);
|
ini_set('display_errors',true);
|
||||||
set_time_limit(10);
|
set_time_limit(10);
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
class Controller_api_test extends Crunchbutton_Controller_Rest {
|
class Controller_api_test extends Crunchbutton_Controller_Rest {
|
||||||
public function init() {
|
public function init() {
|
||||||
$o = new Order(64);
|
|
||||||
|
$o = new Order(111);
|
||||||
$o->notify();
|
$o->notify();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -37,10 +37,23 @@ class Crunchbutton_App extends Cana_App {
|
|||||||
case '_IP_':
|
case '_IP_':
|
||||||
$params['env'] = 'live';
|
$params['env'] = 'live';
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
switch (dirname(__FILE__)) {
|
||||||
|
case '/home/beta.crunchbutton/include/library/Crunchbutton':
|
||||||
|
$params['env'] = 'beta';
|
||||||
|
$_SERVER['__HTTP_HOST'] = 'beta.crunchr.co';
|
||||||
|
break;
|
||||||
|
case '/home/crunchbutton/include/library/Crunchbutton':
|
||||||
|
$params['env'] = 'live';
|
||||||
|
$_SERVER['__HTTP_HOST'] = 'crunchr.co';
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
$params['env'] = 'local';
|
$params['env'] = 'local';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
parent::init($params);
|
parent::init($params);
|
||||||
|
|||||||
@ -6,12 +6,10 @@ class Crunchbutton_Email_Order extends Crunchbutton_Email {
|
|||||||
|
|
||||||
public function __construct($params) {
|
public function __construct($params) {
|
||||||
|
|
||||||
$params['toEmail'] = '_EMAIL';
|
$params['to'] = $params['email'];
|
||||||
$params['toName'] = 'TREST';
|
$params['subject'] = 'Customer Order';
|
||||||
$params['subject'] = 'Contact';
|
$params['from'] = 'Crunchbutton <devin@_DOMAIN_>';
|
||||||
$params['fromEmail'] = 'ubertest@arzynik.com';
|
$params['reply'] = 'replytome@arzynik.com';
|
||||||
$params['replyTo'] = 'replytome@arzynik.com';
|
|
||||||
$params['fromName'] = 'TRESTER';
|
|
||||||
|
|
||||||
$this->buildView($params);
|
$this->buildView($params);
|
||||||
$this->view()->subject = $params['subject'];
|
$this->view()->subject = $params['subject'];
|
||||||
@ -19,6 +17,7 @@ class Crunchbutton_Email_Order extends Crunchbutton_Email {
|
|||||||
$this->view()->message = $params['message'];
|
$this->view()->message = $params['message'];
|
||||||
|
|
||||||
$params['messageHtml'] = $this->view()->render('order/index',['display' => true, 'set' => ['order' => $params['order']]]);
|
$params['messageHtml'] = $this->view()->render('order/index',['display' => true, 'set' => ['order' => $params['order']]]);
|
||||||
|
|
||||||
parent::__construct($params);
|
parent::__construct($params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@ class Crunchbutton_Notification extends Cana_Table {
|
|||||||
//$env = c::env() == 'live' ? 'live' : 'dev';
|
//$env = c::env() == 'live' ? 'live' : 'dev';
|
||||||
$env = 'dev';
|
$env = 'dev';
|
||||||
$num = ($env == 'live' ? $this->value : c::config()->twilio->testnumber);
|
$num = ($env == 'live' ? $this->value : c::config()->twilio->testnumber);
|
||||||
$mail = ($env == 'live' ? $this->value : '_EMAIL');
|
$mail = ($env == 'live' ? $this->value : 'arzynik@gmail.com');
|
||||||
$fax = ($env == 'live' ? $this->value : '_EMAIL');
|
$fax = ($env == 'live' ? $this->value : '_EMAIL');
|
||||||
|
|
||||||
switch ($this->type) {
|
switch ($this->type) {
|
||||||
|
|||||||
@ -72,7 +72,7 @@ class Crunchbutton_Restaurant extends Cana_Table {
|
|||||||
|
|
||||||
public function notifications() {
|
public function notifications() {
|
||||||
if (!isset($this->_notifications)) {
|
if (!isset($this->_notifications)) {
|
||||||
$this->_notifications = Notification::q('select * from notification where id_restaurant="'.$this->id_restaurant.'"');
|
$this->_notifications = Notification::q('select * from notification where id_restaurant="'.$this->id_restaurant.'" and active=1');
|
||||||
}
|
}
|
||||||
return $this->_notifications;
|
return $this->_notifications;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user