mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04: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;
|
$invitation = null;
|
||||||
|
|
||||||
|
$nmo = new NinjaMailerObject;
|
||||||
|
|
||||||
if ($this->payment->invoices && $this->payment->invoices->count() >= 1) {
|
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->mailable = new TemplateEmail($email_builder, $this->contact, $invitation);
|
||||||
$nmo->to_user = $this->contact;
|
$nmo->to_user = $this->contact;
|
||||||
$nmo->settings = $this->settings;
|
$nmo->settings = $this->settings;
|
||||||
|
@ -88,11 +88,22 @@ class EmailRefundPayment implements ShouldQueue
|
|||||||
|
|
||||||
$invitation = null;
|
$invitation = null;
|
||||||
|
|
||||||
|
$nmo = new NinjaMailerObject;
|
||||||
|
|
||||||
if ($this->payment->invoices && $this->payment->invoices->count() >= 1) {
|
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->mailable = new TemplateEmail($email_builder, $this->contact, $invitation);
|
||||||
$nmo->to_user = $this->contact;
|
$nmo->to_user = $this->contact;
|
||||||
$nmo->settings = $this->settings;
|
$nmo->settings = $this->settings;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user