Mail: Fix email to group when group had no email did not email group members

This commit is contained in:
nathan 2023-03-20 10:55:12 -06:00
parent 4d89bd9feb
commit 211c7f9b3a

View File

@ -2836,9 +2836,12 @@ class mail_compose
$addrFromList=array();
foreach((array)$_emailAddressList as $ak => $address)
{
if(is_numeric($address) && $address > 0 || preg_match('/ <(\\d+)@lists.egroupware.org>$/', $address, $matches))
if(is_numeric($address) && $address > 0 || preg_match('/ <(-?\d+)@lists.egroupware.org>$/', $address, $matches))
{
if (!isset($contacts_obs)) $contacts_obj = new Api\Contacts();
if(!isset($contacts_obs))
{
$contacts_obj = new Api\Contacts();
}
// List was selected, expand to addresses
unset($_emailAddressList[$ak]);
foreach($contacts_obj->search('',array('n_fn','n_prefix','n_given','n_family','org_name','email','email_home'),