<?php
/**
 * Created by PhpStorm.
 * User: Wang
 * Date: 2017/2/5
 * Time: 21:32
 */

namespace App\Mailer;

use Mail;
use Naux\Mail\SendCloudTemplate;

class Mailer
{
    public function sendTo($template, $email, array $data)
    {
        $content = new SendCloudTemplate($template, $data);
        Mail::raw($content, function ($message) use ($email) {
            $message->from(config('mail')['from']['address'], config('mail')['from']['name']);

            $message->to($email);
        });
    }
}