Enhancement(機能追加・改善) #1620 » 0001-fixed-opMailSend-sendTemplateMail.patch
lib/util/opMailSend.class.php | ||
---|---|---|
$signature = "\n".$signature;
|
||
}
|
||
$subject = $params['subject'];
|
||
$notificationMail = Doctrine::getTable('NotificationMail')->fetchTemplate($target.'_'.$template);
|
||
if (($notificationMail instanceof NotificationMail) && $notificationMail->getTitle())
|
||
if (!empty($params['subject']))
|
||
{
|
||
$subject = $notificationMail->getTitle();
|
||
$templateStorage = new sfTemplateStorageString($subject);
|
||
$renderer = new opTemplateRendererTwig();
|
||
$params['sf_type'] = null;
|
||
$parameterHolder = new sfViewParameterHolder($context->getEventDispatcher(), $params);
|
||
$subject = $renderer->evaluate($templateStorage, $parameterHolder->toArray());
|
||
$notificationMail->free(true);
|
||
$subject = $params['subject'];
|
||
}
|
||
else
|
||
{
|
||
$notificationMail = Doctrine::getTable('NotificationMail')->fetchTemplate($target.'_'.$template);
|
||
if (($notificationMail instanceof NotificationMail) && $notificationMail->getTitle())
|
||
{
|
||
$subject = $notificationMail->getTitle();
|
||
$templateStorage = new sfTemplateStorageString($subject);
|
||
$renderer = new opTemplateRendererTwig();
|
||
$params['sf_type'] = null;
|
||
$parameterHolder = new sfViewParameterHolder($context->getEventDispatcher(), $params);
|
||
$subject = $renderer->evaluate($templateStorage, $parameterHolder->toArray());
|
||
$notificationMail->free(true);
|
||
}
|
||
}
|
||
|
||
if (empty($subject))
|
||
{
|
||
return false;
|
||
}
|
||
return self::execute($subject, $to, $from, $body.$signature);
|