2017-01-11 13:06:15 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Jobs;
|
|
|
|
|
|
|
|
use App\Models\Payment;
|
|
|
|
use App\Ninja\Mailers\ContactMailer;
|
|
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
|
|
use Monolog\Logger;
|
|
|
|
use Carbon;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class SendInvoiceEmail
|
|
|
|
*/
|
|
|
|
class SendPaymentEmail extends Job implements ShouldQueue
|
|
|
|
{
|
|
|
|
use InteractsWithQueue, SerializesModels;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var Payment
|
|
|
|
*/
|
|
|
|
protected $payment;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new job instance.
|
|
|
|
|
2017-01-11 14:40:13 +01:00
|
|
|
* @param Payment $payment
|
2017-01-11 13:06:15 +01:00
|
|
|
*/
|
|
|
|
public function __construct($payment)
|
|
|
|
{
|
|
|
|
$this->payment = $payment;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Execute the job.
|
|
|
|
*
|
|
|
|
* @param ContactMailer $mailer
|
|
|
|
*/
|
2017-01-11 14:40:13 +01:00
|
|
|
public function handle(ContactMailer $contactMailer)
|
2017-01-11 13:06:15 +01:00
|
|
|
{
|
2017-01-11 14:40:13 +01:00
|
|
|
$contactMailer->sendPaymentConfirmation($this->payment);
|
2017-01-11 13:06:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|