public function addPosition($typ, $description, $comment ) { // Community Builder List $langUsers = array(); $langUsers['de-DE'] = $this->_getUsers( array('Österreich', 'Schweiz', 'Deutschland')); $langUsers['en-GB'] = $this->_getUsers( array('Czech Republic')); foreach( $langUsers as $lang => $users ) { // Lade die Sprache $language = JLanguage::getInstance($lang); $language->load ('com_signalservice' ); // Email Empfänger adressen auslesen $empfanger = array(); foreach( $users as $user ) { $empfanger[] = $user['email']; } // Email Text bauen $subject = sprintf($language->_('NEW_POSITION_SUBJECT'), $typ); $body = sprintf($language->_('NEW_POSITION_BODY'), $newId, JTEXT::_($typ), $description ); if($comment != null && $comment != '' ) $body .= sprintf($language->_('NEW_POSITION_BODY_COMMENT'), $comment); // E-Mail schreiben $this->_writeMails($empfanger, $subject, $body ); } } protected function _writeMails($empfanger, $subject, $body ) { // mailer $mailer =& JFactory::getMailer(); $config =& JFactory::getConfig(); // sender $sender = array( $config->getValue( 'config.mailfrom' ), $config->getValue( 'config.fromname' ) ); $mailer->setSender($sender); // empfänger $mailer->addRecipient( $empfanger ); // betreff $mailer->setSubject( $subject ); $mailer->isHTML(true); $mailer->Encoding = 'base64'; $mailer->setBody($body); // senden return $mailer->Send(); }
MonatJanuar 2012
© 2024 Blog theAlmega
Theme von Anders Norén — Nach oben ↑