mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Client payment failure emails
This commit is contained in:
parent
b8e81df058
commit
70e0a1db52
@ -15,6 +15,7 @@ use App\Jobs\Mail\NinjaMailer;
|
|||||||
use App\Jobs\Mail\NinjaMailerJob;
|
use App\Jobs\Mail\NinjaMailerJob;
|
||||||
use App\Jobs\Mail\NinjaMailerObject;
|
use App\Jobs\Mail\NinjaMailerObject;
|
||||||
use App\Libraries\MultiDB;
|
use App\Libraries\MultiDB;
|
||||||
|
use App\Mail\Admin\ClientPaymentFailureObject;
|
||||||
use App\Mail\Admin\EntityNotificationMailer;
|
use App\Mail\Admin\EntityNotificationMailer;
|
||||||
use App\Mail\Admin\PaymentFailureObject;
|
use App\Mail\Admin\PaymentFailureObject;
|
||||||
use App\Models\Client;
|
use App\Models\Client;
|
||||||
@ -102,6 +103,24 @@ class PaymentFailedMailer implements ShouldQueue
|
|||||||
});
|
});
|
||||||
|
|
||||||
//add client payment failures here.
|
//add client payment failures here.
|
||||||
|
nlog("pre client failure email");
|
||||||
|
|
||||||
|
if($contact = $this->client->primary_contact()->first())
|
||||||
|
{
|
||||||
|
|
||||||
|
nlog("inside failure");
|
||||||
|
|
||||||
|
$mail_obj = (new ClientPaymentFailureObject($this->client, $this->error, $this->company, $this->payment_hash))->build();
|
||||||
|
|
||||||
|
$nmo = new NinjaMailerObject;
|
||||||
|
$nmo->mailable = new NinjaMailer($mail_obj);
|
||||||
|
$nmo->company = $this->company;
|
||||||
|
$nmo->to_user = $contact;
|
||||||
|
$nmo->settings = $settings;
|
||||||
|
|
||||||
|
NinjaMailerJob::dispatch($nmo);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@ namespace App\Mail\Admin;
|
|||||||
use App\Models\Invoice;
|
use App\Models\Invoice;
|
||||||
use App\Utils\HtmlEngine;
|
use App\Utils\HtmlEngine;
|
||||||
use App\Utils\Ninja;
|
use App\Utils\Ninja;
|
||||||
use App\Utils\Number;
|
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
use Illuminate\Support\Facades\App;
|
use Illuminate\Support\Facades\App;
|
||||||
use stdClass;
|
use stdClass;
|
||||||
@ -91,7 +90,7 @@ class ClientPaymentFailureObject
|
|||||||
return
|
return
|
||||||
ctrans(
|
ctrans(
|
||||||
'texts.notification_invoice_payment_failed_subject',
|
'texts.notification_invoice_payment_failed_subject',
|
||||||
['invoice' => $this->client->present()->name()]
|
['invoice' => implode(",", $this->invoices->pluck('number')->toArray())]
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -110,7 +109,7 @@ class ClientPaymentFailureObject
|
|||||||
]
|
]
|
||||||
),
|
),
|
||||||
'greeting' => ctrans('texts.email_salutation', ['name' => $this->client->present()->name]),
|
'greeting' => ctrans('texts.email_salutation', ['name' => $this->client->present()->name]),
|
||||||
'message' => $this->error,
|
'message' => ctrans('texts.client_payment_failure_body', ['invoice' => implode(",", $this->invoices->pluck('number')->toArray()), 'amount' => $this->getAmount()]),
|
||||||
'signature' => $signature,
|
'signature' => $signature,
|
||||||
'logo' => $this->company->present()->logo(),
|
'logo' => $this->company->present()->logo(),
|
||||||
'settings' => $this->client->getMergedSettings(),
|
'settings' => $this->client->getMergedSettings(),
|
||||||
|
@ -1400,7 +1400,7 @@ $LANG = array(
|
|||||||
'more_options' => 'More options',
|
'more_options' => 'More options',
|
||||||
'credit_card' => 'Credit Card',
|
'credit_card' => 'Credit Card',
|
||||||
'bank_transfer' => 'Bank Transfer',
|
'bank_transfer' => 'Bank Transfer',
|
||||||
'no_transaction_reference' => 'We did not recieve a payment transaction reference from the gateway.',
|
'no_transaction_reference' => 'We did not receive a payment transaction reference from the gateway.',
|
||||||
'use_bank_on_file' => 'Use Bank on File',
|
'use_bank_on_file' => 'Use Bank on File',
|
||||||
'auto_bill_email_message' => 'This invoice will automatically be billed to the payment method on file on the due date.',
|
'auto_bill_email_message' => 'This invoice will automatically be billed to the payment method on file on the due date.',
|
||||||
'bitcoin' => 'Bitcoin',
|
'bitcoin' => 'Bitcoin',
|
||||||
@ -4334,7 +4334,8 @@ $LANG = array(
|
|||||||
'clone_to_expense' => 'Clone to expense',
|
'clone_to_expense' => 'Clone to expense',
|
||||||
'checkout' => 'Checkout',
|
'checkout' => 'Checkout',
|
||||||
'acss' => 'Pre-authorized debit payments',
|
'acss' => 'Pre-authorized debit payments',
|
||||||
'invalid_amount' => 'Invalid amount. Number/Decimal values only.'
|
'invalid_amount' => 'Invalid amount. Number/Decimal values only.',
|
||||||
|
'client_payment_failure_body' => 'Payment for Invoice :invoice for amount :amount failed.',
|
||||||
);
|
);
|
||||||
|
|
||||||
return $LANG;
|
return $LANG;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user