MessagePreview.php
[Pman.Core] / MessagePreview.php
index 5066c08..b31bb56 100644 (file)
@@ -83,7 +83,20 @@ class Pman_Core_MessagePreview extends Pman
         
         $x = new $cls;
         
-        if(!method_exists($x, ''))
+        $method = "test_{$core_email->name}";
         
+        if(!method_exists($x, $method)){
+            $this->jerr("{$method} does not exists in {$cls}");
+        }
+//        'HYDRA_INVOICE'
+        $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');
     }
 }