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-11-09 18:32:09 +02:00

23 lines
518 B
PHP
Executable File

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