function get()
{
- if(empty($_REQUEST['_id'])){
- $this->jerr('id got error');
+ if(empty($_REQUEST['_id']) || empty($_REQUEST['_table'])){
+ $this->jerr('Missing Options');
}
- $mlq = DB_DataObject::factory('core_mailing_list_message');
+ $mlq = DB_DataObject::factory($_REQUEST['_table']);
$mlq->get($_REQUEST['_id']);
function post()
{
- if(empty($_REQUEST['_id'])){
- $this->jerr('id got error');
+ if(empty($_REQUEST['_id']) || empty($_REQUEST['_table'])){
+ $this->jerr('Missing Options');
}
+ $mid = $_REQUEST['_id'];
+
+ $mlq = DB_DataObject::factory($_REQUEST['_table']);
+
+ $mlq->get($_REQUEST['_id']);
+
+ $content = array(
+ 'template' => $mlq->name,
+ 'person' => $this->authUser
+ );
+
+ $sent = DB_DataObject::factory($_REQUEST['_table'])->send($content);
+
+ if(!is_object($sent)){
+ $this->jok('SUCCESS');
+ }
+ $this->jerr('error!!:' . $sent->toString());
+
}
-
}