fixed email ordering

This commit is contained in:
arzynik 2012-07-19 06:25:19 -04:00
parent 77eaccdcc8
commit a7542fe3f5
6 changed files with 27 additions and 14 deletions

View File

@ -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);
@ -9,4 +9,4 @@ require_once('../include/crunchbutton.php');
$order = new Order($argv[1]); $order = new Order($argv[1]);
$order->notify(); $order->notify();
//exec('nohup /usr/bin/my-command > /dev/null 2>&1 &'); //exec('nohup /usr/bin/my-command > /dev/null 2>&1 &');

View File

@ -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->notify(); $o = new Order(111);
$o->notify();
} }
} }

View File

@ -38,7 +38,20 @@ class Crunchbutton_App extends Cana_App {
$params['env'] = 'live'; $params['env'] = 'live';
break; break;
default: default:
$params['env'] = 'local'; 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:
$params['env'] = 'local';
break;
}
break; break;
} }
} }

View File

@ -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);
} }
} }

View File

@ -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) {

View File

@ -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;
} }