Skip to content

Instantly share code, notes, and snippets.

@sirawitpra
Created July 1, 2017 12:40
Show Gist options
  • Save sirawitpra/3035da5ef84d54e2fb6a905e3974634b to your computer and use it in GitHub Desktop.
Save sirawitpra/3035da5ef84d54e2fb6a905e3974634b to your computer and use it in GitHub Desktop.
<?php
namespace App\Listeners;
use App\Events\OrderCreated;
use App\Mail\NewOrder;
use Illuminate\Support\Facades\Mail;
class SendConfirmationEmail
{
/**
* Create the event listener.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Handle the event.
*
* @param OrderCreated $event
* @return void
*/
public function handle(OrderCreated $event)
{
Mail::to($event->order->customer_email)->send(new NewOrder($order));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment