1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 07:02:34 +01:00
invoiceninja/app/ninja/mailers/Mailer.php
2014-03-27 14:25:31 +02:00

22 lines
536 B
PHP
Executable File

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