Last active
August 29, 2015 14:25
-
-
Save jasonherndon/0a9c3b43765e430bceb4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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