X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=DataObjects%2FCore_email.php;fp=DataObjects%2FCore_email.php;h=cbaba21282ba5ad3befe6f9d95bf3f36f35545f0;hp=03b9072184b46919f9789805db0cebf2bc2f5d92;hb=581a3326f8c30baf3b33873f2335042753295d2b;hpb=c8c28ad4fd428d676f271af4142af913d47f755a diff --git a/DataObjects/Core_email.php b/DataObjects/Core_email.php index 03b90721..cbaba212 100644 --- a/DataObjects/Core_email.php +++ b/DataObjects/Core_email.php @@ -675,5 +675,38 @@ Content-Transfer-Encoding: 7bit } - + function testData($person, $dt , $core_notify) + { + + // should return the formated email??? + $pg = HTML_FlexyFramework::get()->page; + + + + + if(empty($this->test_class)){ + $pg->jerr("[{$this->name}] does not has test class"); + } + + require_once "{$this->test_class}.php"; + + $cls = str_replace('/', '_', $this->test_class); + + $x = new $cls; + + $method = "test_{$this->name}"; + + if(!method_exists($x, $method)){ + $pg->jerr("{$method} does not exists in {$cls}"); + } + + $content = $x->{$method}($this, $person); + $content['to'] = $person->getEmailFrom(); + + $content['bcc'] = array(); + $data = $this->toMailerData($content); + return $data; + + + } }