DataObjects/Core_enum.php
[Pman.Core] / DataObjects / Core_email.php
index d670901..a026695 100644 (file)
@@ -240,7 +240,7 @@ class Pman_Core_DataObjects_Core_email extends DB_DataObject
         
         if(!empty($unsubscribe)){
             $element = $doc->createElement('img');
-        
+            $element->setAttribute('mailembed', 'no');
             $element->setAttribute('src', $cfg ['server_baseurl']  . '/Crm/Open/' . $this->id . '/{person.id}.html');
             $element->setAttribute('width', '1');
             $element->setAttribute('height', '1');
@@ -281,10 +281,12 @@ class Pman_Core_DataObjects_Core_email extends DB_DataObject
      * convert email with contents into a core mailer object. - ready to send..
      * @param Object|Array $obj Object (or array) to send @see Pman_Core_Mailer
      *    + subject
-     *    + rcpts
+     *    + rcpts || person   << if person is set - then it goes to them...
      *    + replace_links
      *    + template
      *    + mailer_opts
+     *    + person << who it actually goes to..
+     *    
      * @param bool $force - force re-creation of cached version of email.
      *
      * @returns Pman_Core_Mailer
@@ -358,27 +360,9 @@ class Pman_Core_DataObjects_Core_email extends DB_DataObject
         if (is_a($r, 'PEAR_Error')) {
             return $r;
         }
-    /**
-     *
-     * Usage:
-     * $this->rcpts = array('sales@roojs.com');
-     * // or 
-     * $this->rcpts = "Tester <sales@roojs.com>";
-     *
-     * 
-     * // then send it..
-     * $x = DB_DataObject::factory('core_enum');
-     * $x->get('name', 'NAME OF TEMPLATE');
-     * $x->send(array(
-     *      'rcpts' => "Tester <sales@roojs.com>",
-     *      'page' => $this
-     *      'mailer_opts' => array( <<< additional options, like urlmap..)
-     *       'link' => 'http://......'
-       );
-     * // on the template use {link:h} to render the link
-     *
-     *
-     */
+        return $r->toData();
+    }
+  
     function send($obj, $force = true, $send = true)
     {   
         if (!$send) {
@@ -478,7 +462,7 @@ Content-Transfer-Encoding: 7bit
                 continue;
             }
             
-            $images["attachment-$i->id"] = array(
+            $images["attachment-{$i->id}"] = array(
                 'file' => $i->getStoreName(),
                 'mimetype' => $i->mimetype,
                 'ext' => $y->toExt($i->mimetype),