Skip to content

Instantly share code, notes, and snippets.

@jasonherndon
Last active August 29, 2015 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonherndon/0a9c3b43765e430bceb4 to your computer and use it in GitHub Desktop.
Save jasonherndon/0a9c3b43765e430bceb4 to your computer and use it in GitHub Desktop.
<?php
namespace App\Services\Utility;
use Log;
use Mail;
use Exception;
class SendMail {
/**
* Send mail
*
* @var array
* @return boolean
*/
public function sendMail(array $email){
try {
Mail::send($email['template'], $email, function($message) use ($email)
{
$message->to($email['recipient_email'], $email['recipient_name'])->subject($email['subject']);
});
} catch (Exception $e)
{
// Send do download page
Log::info('Mail failed to send: '.$email['recipient_email']);
return false;
}
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment