public function ajaxforumaddAction()
 {
     if ($_POST) {
         $result = FM_Components_Util_ForumItem::insertForumItem($_POST);
         $_POST['date'] = date('m-d-Y H:i', time());
         if ($id = $result) {
             $org = new FM_Components_Organization(array('id' => $_POST['orgId']));
             $admin = new FM_Components_Member(array('id' => $org->getAdminId()));
             $headers = 'MIME-Version: 1.0' . "\r\n";
             $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
             $headers .= 'From: Your Site @ 4Monmouth.com' . "\r\n" . 'Reply-To: nobody@4monmouth.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
             mail($admin->getEmail(), 'A Comment Has Been Posted To your Forum @ 4Monmouth.com', FM_Components_EmailFormatter::forumComment($_POST, $org), $headers);
             //print $admin->getEmail();
         }
         $siteAdmin = false;
         if ($this->_user && ($this->_user->inOrg($this->_request->getParam('id')) || $this->_user->isRoot())) {
             //user is admin for this group, show edit
             $siteAdmin = true;
         }
         $_POST['admin'] = $siteAdmin;
         $_POST['id'] = $id;
         print $result ? Zend_Json::encode($_POST) : '0';
         exit;
     }
 }
 public function ajaxcontactusAction()
 {
     if ($_POST) {
         if ($id = FM_Components_Email::insertEmail($_POST)) {
             $org = new FM_Components_Organization(array('id' => $_POST['orgId']));
             $user = new FM_Components_Member(array('id' => $org->getAdminId()));
             $headers = 'MIME-Version: 1.0' . "\r\n";
             $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
             $headers .= 'From:' . $org->getName() . '  @ 4Monmouth.com' . "\r\n" . 'Reply-To: nobody@4monmouth.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
             //print $user->getEmail();
             mail($user->getEmail(), 'You recieved an email from your 4monmouth miniweb', FM_Components_EmailFormatter::contactUs($_POST), $headers);
             mail($_POST['email'], 'Your question has been submitted', FM_Components_EmailFormatter::contactUs($_POST), $headers);
             print 'Your email has been sent. You should expect a response within 24 - 48 hours.';
         } else {
             print 'Your email failed to send. Please try again';
         }
     }
     exit;
 }