mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-09-20 16:31:33 +02:00
Add invitation to payment emails
This commit is contained in:
parent
30f349ae13
commit
e69869e06c
@ -83,11 +83,21 @@ class EmailPayment implements ShouldQueue
|
||||
|
||||
$invitation = null;
|
||||
|
||||
$nmo = new NinjaMailerObject;
|
||||
|
||||
if ($this->payment->invoices && $this->payment->invoices->count() >= 1) {
|
||||
$invitation = $this->payment->invoices->first()->invitations()->first();
|
||||
|
||||
if($this->contact){
|
||||
$invitation = $this->payment->invoices->first()->invitations()->where('contact_id', $this->contact->id)->first();
|
||||
}
|
||||
else
|
||||
$invitation = $this->payment->invoices->first()->invitations()->first();
|
||||
|
||||
if($invitation)
|
||||
$nmo->invitation = $invitation;
|
||||
}
|
||||
|
||||
$nmo = new NinjaMailerObject;
|
||||
|
||||
$nmo->mailable = new TemplateEmail($email_builder, $this->contact, $invitation);
|
||||
$nmo->to_user = $this->contact;
|
||||
$nmo->settings = $this->settings;
|
||||
|
@ -88,11 +88,22 @@ class EmailRefundPayment implements ShouldQueue
|
||||
|
||||
$invitation = null;
|
||||
|
||||
$nmo = new NinjaMailerObject;
|
||||
|
||||
if ($this->payment->invoices && $this->payment->invoices->count() >= 1) {
|
||||
$invitation = $this->payment->invoices->first()->invitations()->first();
|
||||
|
||||
if($this->contact) {
|
||||
$invitation = $this->payment->invoices->first()->invitations()->where('contact_id', $this->contact->id)->first();
|
||||
} else {
|
||||
$invitation = $this->payment->invoices->first()->invitations()->first();
|
||||
}
|
||||
|
||||
if($invitation)
|
||||
$nmo->invitation = $invitation;
|
||||
}
|
||||
|
||||
$nmo = new NinjaMailerObject;
|
||||
|
||||
|
||||
$nmo->mailable = new TemplateEmail($email_builder, $this->contact, $invitation);
|
||||
$nmo->to_user = $this->contact;
|
||||
$nmo->settings = $this->settings;
|
||||
|
Loading…
Reference in New Issue
Block a user