public function getAvailableMailTemplates($list = false, $target = false) { $select = $this->loader->getModels()->getCommTemplateModel()->getSelect(); if ($target) { if (is_array($target)) { $select->where('gct_target IN (?)', $target); } else { $select->where('gct_target = ?', $target); } } $templates = $this->db->fetchPairs($select); if (!$list) { $templates = array('' => '') + $templates; } return $templates; }