return true;
}
- function get()
+ function get($v, $opts=array())
{
+
if(empty($_REQUEST['_id']) || empty($_REQUEST['_table'])){
$this->jerr('Missing Options');
}
}
- function post()
+ function post($v)
{
if(empty($_REQUEST['_id']) || empty($_REQUEST['_table'])){
$this->jerr('Missing Options');
$this->coreEmailSendTest();
}
+ $cn = DB_DataObject::factory('core_notify');
+ $cn->setFrom(array(
+ 'evtype' => "{$_REQUEST['_table']}::SendPreviewEmail",
+ 'onid' => $_REQUEST['_id'],
+ 'ontable' => $_REQUEST['_table'],
+ 'person_id' => $this->authUser->id,
+ 'person_table' => 'Person',
+ 'act_when' => $cn->sqlValue("NOW()"),
+ 'act_start' => $cn->sqlValue("NOW()")
+ ));
+
+ $cn->insert();
+
+ $sent = $cn->sendManual();
+
+ if(get_class($sent) != 'Pman_Core_NotifySend_Exception_Success'){
+ $this->jerr($sent->getMessage());
+ }
+
+ $this->jok("SUCCESS");
+
+ /*
$mid = $_REQUEST['_id'];
$mlq = DB_DataObject::factory($_REQUEST['_table']);
}
$this->jerr('error!!:' . $sent->toString());
-
+ */
}
function coreEmailSendTest()
if(!method_exists($x, $method)){
$this->jerr("{$method} does not exists in {$cls}");
}
-
+
$content = $x->{$method}($this, $this->authUser);
- $sent = $this->send($content);
+ $content['bcc'] = array();
+
+ $sent = $core_email->send($content);
if(is_object($sent)){
$this->jerr("Error sending email - " . $sent->toString());