1
0
Fork 0
mirror of https://github.com/Oreolek/kangana.git synced 2024-06-16 23:11:07 +03:00
This commit is contained in:
Alexander Yakovlev 2014-02-21 13:57:10 +07:00
parent 12a7db25e3
commit a8a35d03bd
4 changed files with 7 additions and 26 deletions

View file

@ -58,7 +58,11 @@ class Model_Instant extends ORM {
{
Log::instance()->add(Log::NOTICE, __('Sending letter with subject "%subject" to address %address', array('%subject' => $subject, '%address' => $address)));
$sender = Kohana::$config->load('email')->get('sender');
$email = Email::factory($subject, $text)->from($sender[0], $sender[1]);
$template = new View_Letter_View;
$template->content = $text;
$template->token = $token;
$renderer = Kostache_Layout::factory($template->_layout);
$email = Email::factory($subject, $renderer->render($template, $template->_view))->from($sender[0], $sender[1]);
if (is_array($address))
{
$email->bcc($address);

View file

@ -69,6 +69,8 @@ class Model_Letter extends ORM {
Log::instance()->add(Log::NOTICE, __('Sending letter with subject "%subject" to address %address', array('%subject' => $subject, '%address' => $address)));
$sender = Kohana::$config->load('email')->get('sender');
$template = new View_Letter_View;
$template->content = $text;
$template->token = $token;
$renderer = Kostache_Layout::factory($template->_layout);
$email = Email::factory($subject, $renderer->render($template, $template->_view))->from($sender[0], $sender[1]);
if (is_array($address))

View file

@ -19,28 +19,4 @@ class View_Letter_View extends View {
{
return Kostache::factory()->render($this->content);
}
public function scripts()
{
$scripts = $this->scripts;
$temp = "";
foreach($scripts as $script):
if (strstr($script, '://') === FALSE) //no protocol given, script is local
{
if ($script === 'jquery') // CDN shortcut
{
$temp .= HTML::script('https://yandex.st/jquery/2.0.3/jquery.min.js')."\n";
}
else
{
$temp .= HTML::script('application/assets/javascript/'.$script)."\n";
}
}
else
{
$temp .= HTML::script($script)."\n";
}
endforeach;
return $temp;
}
}

View file

@ -15,6 +15,5 @@
{{>content}}
</div>
</div>
{{{scripts}}}
</body>
</html>