DataObjects/I18n.php
[Pman.Core] / NotifySend.php
index 228d905..e0e48e5 100644 (file)
@@ -173,7 +173,7 @@ class Pman_Core_NotifySend extends Pman
          
         // this may modify $p->email. (it will not update it though)
         $email =  $this->makeEmail($o, $p, $last, $w, $force);
-        print_r($email);exit;
+        
         if ($email === true)  {
             
             $ev = $this->addEvent('NOTIFY', $w,
@@ -477,15 +477,17 @@ class Pman_Core_NotifySend extends Pman
     {
         $m = 'notify'. $notify->evtype;
         //var_dump(get_class($object) . '::' .$m);
-        
         if (!empty($notify->evtype) && method_exists($object,$m)) {
             echo "calling :" . get_class($object) . '::' .$m . "\n";
             return $object->$m($rcpt, $last_sent_date, $notify, $force);
         }
         
-        if(!empty($notify->evtype) && $notify->evtype == 'campaign_detail::drawWinner'){
-            echo "calling :" . $notify->evtype . "\n";
-            return $object->drawWinner($rcpt, $last_sent_date, $notify, $force);
+        $type = explode('::', $notify->evtype);
+        
+        if(!empty($type[1]) && method_exists($object,$type[1])){
+            $m = $type[1];
+            echo "calling :" . get_class($object) . '::' .$m . "\n";
+            return $object->$m($rcpt, $last_sent_date, $notify, $force);
         }
                 
         if (!method_exists($object, 'toEmail')) {