diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index d22a0d27cd..54ec62500b 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -493,9 +493,6 @@ class InvoiceController extends BaseController return response(['message' => 'Please verify your account to send emails.'], 400); } - /**@var \App\Models\User $user */ - $user = auth()->user(); - if(in_array($request->action, ['auto_bill','mark_paid']) && $user->cannot('create', \App\Models\Payment::class)) { return response(['message' => ctrans('texts.not_authorized'), 'errors' => ['ids' => [ctrans('texts.not_authorized')]]], 422); } diff --git a/app/Jobs/Mail/NinjaMailerJob.php b/app/Jobs/Mail/NinjaMailerJob.php index 9fc9acf136..a20efd9bf7 100644 --- a/app/Jobs/Mail/NinjaMailerJob.php +++ b/app/Jobs/Mail/NinjaMailerJob.php @@ -85,14 +85,14 @@ class NinjaMailerJob implements ShouldQueue /* Serializing models from other jobs wipes the primary key */ $this->company = Company::query()->where('company_key', $this->nmo->company->company_key)->first(); + /* Set the email driver */ + $this->setMailDriver(); + /* If any pre conditions fail, we return early here */ if (!$this->company || $this->preFlightChecksFail()) { return; } - /* Set the email driver */ - $this->setMailDriver(); - /* Run time we set Reply To Email*/ if (strlen($this->nmo->settings->reply_to_email) > 1) { if (property_exists($this->nmo->settings, 'reply_to_name')) { @@ -513,7 +513,7 @@ class NinjaMailerJob implements ShouldQueue } /* GMail users are uncapped */ - if (Ninja::isHosted() && ($this->nmo->settings->email_sending_method == 'gmail' || $this->nmo->settings->email_sending_method == 'office365')) { + if (Ninja::isHosted() && (in_array($this->nmo->settings->email_sending_method, ['gmail', 'office365', 'client_postmark', 'client_mailgun']))) { return false; } diff --git a/app/Services/Email/Email.php b/app/Services/Email/Email.php index 093febece8..1373fb726d 100644 --- a/app/Services/Email/Email.php +++ b/app/Services/Email/Email.php @@ -87,6 +87,9 @@ class Email implements ShouldQueue ->setDefaults() ->buildMailable(); + /** Ensure quota's on hosted platform are respected. :) */ + $this->setMailDriver(); + if ($this->preFlightChecksFail()) { return; } @@ -228,7 +231,7 @@ class Email implements ShouldQueue */ public function email() { - $this->setMailDriver(); + // $this->setMailDriver(); /* Init the mailer*/ $mailer = Mail::mailer($this->mailer); diff --git a/config/ninja.php b/config/ninja.php index af465af6f9..f072c3884d 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -31,7 +31,7 @@ return [ 'company_id' => 0, 'hash_salt' => env('HASH_SALT', ''), 'currency_converter_api_key' => env('OPENEXCHANGE_APP_ID', ''), - 'enabled_modules' => 32767, + 'enabled_modules' => 65535, 'phantomjs_key' => env('PHANTOMJS_KEY', 'a-demo-key-with-low-quota-per-ip-address'), 'phantomjs_secret' => env('PHANTOMJS_SECRET', false), 'phantomjs_pdf_generation' => env('PHANTOMJS_PDF_GENERATION', false), diff --git a/package-lock.json b/package-lock.json index f1466debb8..1e4593041b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "@invoiceninja/invoiceninja", + "name": "invoiceninja", "lockfileVersion": 2, "requires": true, "packages": {