Changeset View
Changeset View
Standalone View
Standalone View
src/app/Mail/PaymentFailure.php
- This file was added.
<?php | |||||
namespace App\Mail; | |||||
use App\Payment; | |||||
use App\User; | |||||
use App\Utils; | |||||
use Illuminate\Bus\Queueable; | |||||
use Illuminate\Mail\Mailable; | |||||
use Illuminate\Queue\SerializesModels; | |||||
class PaymentFailure extends Mailable | |||||
{ | |||||
use Queueable; | |||||
use SerializesModels; | |||||
/** @var \App\Payment A payment operation */ | |||||
protected $payment; | |||||
/** @var \App\User A wallet controller to whom the email is being send */ | |||||
protected $user; | |||||
/** | |||||
* Create a new message instance. | |||||
* | |||||
* @param \App\Payment $payment A payment operation | |||||
* @param \App\User $user An email recipient | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function __construct(Payment $payment, User $user) | |||||
{ | |||||
$this->payment = $payment; | |||||
$this->user = $user; | |||||
} | |||||
/** | |||||
* Build the message. | |||||
* | |||||
* @return $this | |||||
*/ | |||||
public function build() | |||||
{ | |||||
$user = $this->user; | |||||
$subject = \trans('mail.paymentfailure-subject', ['site' => \config('app.name')]); | |||||
$this->view('emails.payment_failure') | |||||
->subject($subject) | |||||
->with([ | |||||
'site' => \config('app.name'), | |||||
'subject' => $subject, | |||||
'username' => $user->name(true), | |||||
'walletUrl' => Utils::serviceUrl('/wallet'), | |||||
'supportUrl' => \config('app.support_url'), | |||||
]); | |||||
return $this; | |||||
} | |||||
} |