Merge pull request #6108 from turbo124/v5-develop

Fixes for mailers
This commit is contained in:
David Bomba 2021-06-23 08:17:46 +10:00 committed by GitHub
commit d1d0945089
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 8 deletions

View File

@ -28,7 +28,7 @@ class CompanySettings extends BaseSettings
public $lock_invoices = 'off'; //off,when_sent,when_paid //@implemented public $lock_invoices = 'off'; //off,when_sent,when_paid //@implemented
public $enable_client_portal_tasks = false; //@ben to implement public $enable_client_portal_tasks = false; //@ben to implement
public $show_all_tasks_client_portal = 'all'; // all, uninvoiced, invoiced public $show_all_tasks_client_portal = 'invoiced'; // all, uninvoiced, invoiced
public $enable_client_portal_password = false; //@implemented public $enable_client_portal_password = false; //@implemented
public $enable_client_portal = true; //@implemented public $enable_client_portal = true; //@implemented
public $enable_client_portal_dashboard = false; // @TODO There currently is no dashboard so this is pending public $enable_client_portal_dashboard = false; // @TODO There currently is no dashboard so this is pending

View File

@ -0,0 +1,31 @@
<?php
namespace App\Http\Requests\ClientPortal\PaymentMethod;
use App\Http\Requests\Request;
use Illuminate\Foundation\Http\FormRequest;
class VerifyPaymentMethodRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'transactions.*' => 'integer'
];
}
}

View File

@ -101,6 +101,7 @@ class NinjaMailerJob implements ShouldQueue
//send email //send email
try { try {
nlog("trying to send to {$this->nmo->to_user->email} ". now()->toDateTimeString()); nlog("trying to send to {$this->nmo->to_user->email} ". now()->toDateTimeString());
nlog("Using mailer => ". $this->mailer);
Mail::mailer($this->mailer) Mail::mailer($this->mailer)
->to($this->nmo->to_user->email) ->to($this->nmo->to_user->email)
@ -146,11 +147,7 @@ class NinjaMailerJob implements ShouldQueue
{ {
/* Singletons need to be rebooted each time just in case our Locale is changing*/ /* Singletons need to be rebooted each time just in case our Locale is changing*/
App::forgetInstance('translator'); App::forgetInstance('translator');
// App::forgetInstance('mail.manager'); //singletons must be destroyed!
// App::forgetInstance('mailer');
// App::forgetInstance('laravelgmail');
$t = app('translator'); $t = app('translator');
/* Inject custom translations if any exist */
$t->replace(Ninja::transformTranslations($this->nmo->settings)); $t->replace(Ninja::transformTranslations($this->nmo->settings));
switch ($this->nmo->settings->email_sending_method) { switch ($this->nmo->settings->email_sending_method) {
@ -165,7 +162,6 @@ class NinjaMailerJob implements ShouldQueue
break; break;
} }
(new MailServiceProvider(app()))->register();
} }
private function setGmailMailer() private function setGmailMailer()

View File

@ -13,6 +13,7 @@
namespace App\PaymentDrivers\Stripe; namespace App\PaymentDrivers\Stripe;
use App\Exceptions\PaymentFailed; use App\Exceptions\PaymentFailed;
use App\Http\Requests\ClientPortal\PaymentMethod\VerifyPaymentMethodRequest;
use App\Http\Requests\Request; use App\Http\Requests\Request;
use App\Jobs\Mail\NinjaMailerJob; use App\Jobs\Mail\NinjaMailerJob;
use App\Jobs\Mail\NinjaMailerObject; use App\Jobs\Mail\NinjaMailerObject;
@ -87,7 +88,7 @@ class ACH
return render('gateways.stripe.ach.verify', $data); return render('gateways.stripe.ach.verify', $data);
} }
public function processVerification(Request $request, ClientGatewayToken $token) public function processVerification(VerifyPaymentMethodRequest $request, ClientGatewayToken $token)
{ {
$this->stripe->init(); $this->stripe->init();