if (!$replace_links) {
continue;
}
+ if (empty($cfg)) {
+ continue;
+ }
+ // not available if server_baseurl not set... and crm module not used.
$link = DB_DataObject::factory('crm_mailing_list_link');
$link->setFrom(array(
'url' => $href
}
- if(!empty($unsubscribe)){
+ if(!empty($unsubscribe) && !empty($cfg)){
$element = $doc->createElement('img');
$element->setAttribute('mailembed', 'no');
$element->setAttribute('src', $cfg ['server_baseurl'] . '/Crm/Open/' . $this->id . '/{person.id}.html');
// fill in BCC
- if (!empty($this->bcc_group_id) && $this->bcc_group_id > 0 && empty($contents['rcpts_group'])) {
+ if (empty($contents['bcc']) && !empty($this->bcc_group_id) && $this->bcc_group_id > 0 && empty($contents['rcpts_group'])) {
$admin_grp = DB_DAtaObject::Factory('core_group')->load($this->bcc_group_id);
- $admin = $admin_grp->memberS('email');
+ $admin = $admin_grp->members('email');
- if (empty($admin) ) {
+ if (empty($admin) && $admin_grp->name != 'Empty Group') { // allow 'empty group mname'
return $p->raiseError("template [{$contents['template']}] - bcc group is empty");
}