require_once "{$core_email->test_class}.php";
- $cls = new str_replace('/', '_', $core_email->test_class);
+ $cls = str_replace('/', '_', $core_email->test_class);
- print_R($cls);exit;
+ $x = new $cls;
+ $method = "test_{$core_email->name}";
+
+ if(!method_exists($x, $method)){
+ $this->jerr("{$method} does not exists in {$cls}");
+ }
+
+ $content = $x->{$method}($this, $this->authUser);
+
+ $sent = $core_email->send($content);
+
+ if(is_object($sent)){
+ $this->jerr("Error sending email - " . $sent->toString());
+ }
+
+ $this->jok('SUCCESS');
}
}