1. Создаем папку /frontend/modules/sfApply/actions
2. Создаем в ней файл actions.php с содержимым:
require_once(sfConfig::get('sf_symfony_lib_dir').'/plugins/sfDoctrineApplyPlugin/modules/sfApply/lib/BasesfApplyActions.class.php');
class sfApplyActions extends BasesfApplyActions
{
function mail($options)
{
$required = array('subject', 'parameters', 'email', 'fullname', 'html', 'text');
foreach ($required as $option)
{
if (!isset($options[$option]))
{
throw new sfException("Required option $option not supplied to sfApply::mail");
}
}
$from = $this->getFromAddress();
$message=$this->getMailer()->compose(
array($from['email']=>$from['fullname']),
array($options['email']=>$options['fullname']),
$options['subject'],
$this->getPartial($options['text'], $options['parameters'])
);
$message->addPart($this->getPartial($options['html'], $options['parameters']),'text/html');
$this->getMailer()->send($message);
}
}
3. В apps/frontend/config/factories.yml в секции all добавляем
mailer:
class: sfMailer
param:
logging: %SF_LOGGING_ENABLED%
charset: %SF_CHARSET%
delivery_strategy: realtime
transport:
class: Swift_SmtpTransport
param:
host: localhost
port: 25
encryption: ~
username: ~
password: ~
4. В этом же файле убедиться, то закомментированы строки
# delivery_strategy: none
Комментариев нет:
Отправить комментарий