138 |
138 |
$signature = "\n".$signature;
|
139 |
139 |
}
|
140 |
140 |
|
141 |
|
$subject = $params['subject'];
|
142 |
|
$notificationMail = Doctrine::getTable('NotificationMail')->fetchTemplate($target.'_'.$template);
|
143 |
|
if (($notificationMail instanceof NotificationMail) && $notificationMail->getTitle())
|
|
141 |
if (!empty($params['subject']))
|
144 |
142 |
{
|
145 |
|
$subject = $notificationMail->getTitle();
|
146 |
|
$templateStorage = new sfTemplateStorageString($subject);
|
147 |
|
$renderer = new opTemplateRendererTwig();
|
148 |
|
$params['sf_type'] = null;
|
149 |
|
$parameterHolder = new sfViewParameterHolder($context->getEventDispatcher(), $params);
|
150 |
|
$subject = $renderer->evaluate($templateStorage, $parameterHolder->toArray());
|
151 |
|
$notificationMail->free(true);
|
|
143 |
$subject = $params['subject'];
|
|
144 |
}
|
|
145 |
else
|
|
146 |
{
|
|
147 |
$notificationMail = Doctrine::getTable('NotificationMail')->fetchTemplate($target.'_'.$template);
|
|
148 |
if (($notificationMail instanceof NotificationMail) && $notificationMail->getTitle())
|
|
149 |
{
|
|
150 |
$subject = $notificationMail->getTitle();
|
|
151 |
$templateStorage = new sfTemplateStorageString($subject);
|
|
152 |
$renderer = new opTemplateRendererTwig();
|
|
153 |
$params['sf_type'] = null;
|
|
154 |
$parameterHolder = new sfViewParameterHolder($context->getEventDispatcher(), $params);
|
|
155 |
$subject = $renderer->evaluate($templateStorage, $parameterHolder->toArray());
|
|
156 |
$notificationMail->free(true);
|
|
157 |
}
|
|
158 |
}
|
|
159 |
|
|
160 |
if (empty($subject))
|
|
161 |
{
|
|
162 |
return false;
|
152 |
163 |
}
|
153 |
164 |
|
154 |
165 |
return self::execute($subject, $to, $from, $body.$signature);
|
155 |
|
-
|