/** * Get the mail addresses for a monitor * * @param string $monitorName ProjectSettings name * @param string $where Optional, a gems__staff SQL WHERE statement * @return boolean */ protected function _getMailTo($monitorName, $where = null) { $projTo = $this->project->getMonitorTo($monitorName); if ($where) { $dbTo = $this->db->fetchCol("SELECT DISTINCT gsf_email FROM gems__staff WHERE LENGTH(gsf_email) > 5 AND {$where}"); if ($dbTo) { if ($projTo) { return array_unique(array_merge($dbTo, array_filter(array_map('trim', explode(',', $projTo))))); } return $dbTo; } } if ($projTo) { return $projTo; } return false; }