invoiceninja/app/Jobs/SendPaymentEmail.php

49 lines
919 B
PHP
Raw Normal View History

2017-01-11 14:06:15 +02:00
<?php
namespace App\Jobs;
use App\Models\Payment;
use App\Ninja\Mailers\ContactMailer;
use Illuminate\Contracts\Queue\ShouldQueue;
2017-01-30 21:40:43 +02:00
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
2017-01-11 14:06:15 +02:00
/**
2017-01-30 21:40:43 +02:00
* Class SendInvoiceEmail.
2017-01-11 14:06:15 +02:00
*/
class SendPaymentEmail extends Job implements ShouldQueue
{
use InteractsWithQueue, SerializesModels;
/**
* @var Payment
*/
protected $payment;
2017-05-04 20:08:27 +03:00
/**
* @var string
*/
protected $server;
2017-01-11 14:06:15 +02:00
/**
* Create a new job instance.
2017-01-11 15:40:13 +02:00
* @param Payment $payment
2017-01-11 14:06:15 +02:00
*/
public function __construct($payment)
{
$this->payment = $payment;
2017-05-04 20:08:27 +03:00
$this->server = config('database.default');
2017-01-11 14:06:15 +02:00
}
/**
* Execute the job.
*
* @param ContactMailer $mailer
*/
2017-01-11 15:40:13 +02:00
public function handle(ContactMailer $contactMailer)
2017-01-11 14:06:15 +02:00
{
2017-01-11 15:40:13 +02:00
$contactMailer->sendPaymentConfirmation($this->payment);
2017-01-11 14:06:15 +02:00
}
}