public function executeSendMailOnComment() { // Mail action cannot be called directly from the outside $this->forward404If($this->getController()->getActionStack()->getSize() == 1); sfLoader::loadHelpers(array('I18N')); $this->comment = $this->getRequest()->getAttribute('comment'); $mail = new sfMail(); $mail->setCharset('utf-8'); $mail->setSender('no-reply@' . $this->getRequest()->getHost()); $mail->setMailer('mail'); $mail->setFrom($mail->getSender(), sfConfig::get('app_sfSimpleBlog_title')); $mail->addAddresses(sfConfig::get('app_sfSimpleBlog_email')); if ($this->comment->getIsModerated()) { $subject_string = '[%1%] Please moderate: New comment on "%2%"'; } else { $subject_string = '[%1%] New comment on "%2%"'; } $mail->setSubject(__($subject_string, array('%1%' => sfConfig::get('app_sfSimpleBlog_title'), '%2%' => $this->comment->getPostTitle()))); $this->mail = $mail; }