Fixes for payment notifications

This commit is contained in:
David Bomba 2020-11-09 21:26:36 +11:00
parent 9174b7e628
commit af39d5e50c
2 changed files with 5 additions and 5 deletions

View File

@ -53,11 +53,11 @@ class EntityPaidMailer extends BaseMailerJob implements ShouldQueue
* @param $user * @param $user
* @param $company * @param $company
*/ */
public function __construct($payment, $company) public function __construct($payment, $company, $user)
{ {
$this->company = $company; $this->company = $company;
$this->user = $payment->user; $this->user = $user;
$this->payment = $payment; $this->payment = $payment;
@ -84,7 +84,7 @@ class EntityPaidMailer extends BaseMailerJob implements ShouldQueue
try { try {
$mail_obj = (new EntityPaidObject($this->payment))->build(); $mail_obj = (new EntityPaidObject($this->payment))->build();
$mail_obj->from = [$this->payment->user->email, $this->payment->user->present()->name()]; $mail_obj->from = [$this->user->email, $this->user->present()->name()];
//send email //send email
Mail::to($this->user->email) Mail::to($this->user->email)
@ -96,7 +96,7 @@ class EntityPaidMailer extends BaseMailerJob implements ShouldQueue
} }
if (count(Mail::failures()) > 0) { if (count(Mail::failures()) > 0) {
$this->logMailError(Mail::failures(), $this->entity->client); $this->logMailError(Mail::failures(), $this->payment->client);
} else { } else {
// $this->entityEmailSucceeded(); // $this->entityEmailSucceeded();
} }

View File

@ -63,7 +63,7 @@ class PaymentNotification implements ShouldQueue
if (($key = array_search('mail', $methods)) !== false) { if (($key = array_search('mail', $methods)) !== false) {
unset($methods[$key]); unset($methods[$key]);
EntityPaidMailer::dispatch($payment, $payment->company); EntityPaidMailer::dispatch($payment, $payment->company, $user);
} }