Index: branches/5.2.x/core/units/helpers/mailing_list_helper.php =================================================================== diff -u -N -r14244 -r14628 --- branches/5.2.x/core/units/helpers/mailing_list_helper.php (.../mailing_list_helper.php) (revision 14244) +++ branches/5.2.x/core/units/helpers/mailing_list_helper.php (.../mailing_list_helper.php) (revision 14628) @@ -1,6 +1,6 @@ 0) { + $email_address = $name = ''; + + if ( $mailing_data['PortalUserId'] > 0 ) { $sender =& $this->Application->recallObject('u.-item', null, Array ('skip_autoload' => true)); /* @var $sender UsersItem */ $sender->Load($mailing_data['PortalUserId']); $email_address = $sender->GetDBField('Email'); - $name = trim( $sender->GetDBField('FirstName') . ' ' . $sender->GetDBField('LastName') ); + $name = trim($sender->GetDBField('FirstName') . ' ' . $sender->GetDBField('LastName')); $is_root = false; } - if ($is_root || !$email_address) { + if ( $is_root || !$email_address ) { $email_address = $this->Application->ConfigValue('Smtp_AdminMailFrom'); } - if ($is_root || !$name) { - $name = strip_tags( $this->Application->ConfigValue('Site_Name') ); + if ( $is_root || !$name ) { + $name = strip_tags($this->Application->ConfigValue('Site_Name')); } return Array ($name, $email_address); @@ -149,7 +153,7 @@ } if ($recipient_type != 'u' && $recipient_type != 'g') { - // theese are already emails + // these are already emails return $recipient_ids; } @@ -166,6 +170,10 @@ LEFT JOIN ' . TABLE_PREFIX . 'PortalUser u ON u.PortalUserId = ug.PortalUserId WHERE (ug.GroupId IN (' . implode(',', $recipient_ids) . ')) AND (u.Email <> "")'; break; + + default: + $sql = ''; + break; } return $this->Conn->GetCol($sql);