1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 13:42:49 +01:00
invoiceninja/app/ninja/mailers/Mailer.php
2014-01-07 15:50:41 +00:00

19 lines
408 B
PHP
Executable File

<?php namespace ninja\mailers;
use Mail;
abstract class Mailer {
public function sendTo($toEmail, $fromEmail, $subject, $view, $data = [])
{
$views = [
'html' => 'emails.'.$view.'_html',
'text' => 'emails.'.$view.'_text'
];
Mail::queue($views, $data, function($message) use ($toEmail, $fromEmail, $subject)
{
$message->to($toEmail)->replyTo($fromEmail)->subject($subject);
});
}
}