/** * This function is used to write email constants to a php file. */ public static function generateEmailConstants() { $filename = Zend_Registry::get('emailconstant_file_path'); $email_model = new Default_Model_Emailcontacts(); $egroups_data = $email_model->getContactsForConstants(); $egroup_content = "<?php "; foreach ($egroups_data as $egroups) { $egroup_content .= "\ndefined('" . preg_replace('/\\s/', '_', $egroups['group_code']) . "_" . $egroups['business_unit_id'] . "') || define('" . preg_replace('/\\s/', '_', $egroups['group_code']) . "_" . $egroups['business_unit_id'] . "','" . $egroups['groupEmail'] . "');"; } $egroup_content .= "?>"; $handle = fopen($filename, "w+"); fwrite($handle, trim($egroup_content)); fclose($handle); }
public function getmailcntAction() { $bunit_id = $this->_getParam('bunit_id', null); $group_id = $this->_getParam('group_id', null); $email_model = new Default_Model_Emailcontacts(); $result = 'no'; $cnt = $email_model->getemailcnt($bunit_id, $group_id); if ($cnt > 0) { $result = "yes"; } $this->_helper->json(array('result' => $result)); }