*
* @param bool $force - force re-creation of cached version of email.
*
- * @returns Pman_Core_Mailer
+ * @returns Pman_Core_Mailer||PEAR_Error
*/
function toMailer($obj,$force=false)
$contents = (array)$obj;
+
+ if(empty($this->id) && !empty($contents['template'])){
+ $this->get('name', $contents['template']);
+ }
+
+ if(empty($this->id)){
+ $p = new PEAR();
+ return $p->raiseError("template [{$contents['template']}] has not been set");
+ }
+
// fill in BCC
- if (!empty($this->bcc_group)) {
+ if (!empty($this->bcc_group) && empty($contents['rcpts_group'])) {
$group = DB_DataObject::factory('groups');
$group->get($this->bcc_group);
$contents->bcc = $ar;
}
}
+ if (!empty($contents['rcpts_group'])) {
+
+
+
+ }
- if(empty($this->id) && !empty($contents['template'])){
- $this->get('name', $contents['template']);
- }
+
- if(empty($this->id)){
- $p = new PEAR();
- return $p->raiseError("template [{$contents['template']}] has not been set");
- }
if(empty($contents['subject'])){
$contents['subject'] = $this->subject;