mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Allow individual SMTP per company
This commit is contained in:
parent
49ded586ee
commit
ebaa1b4071
@ -133,10 +133,7 @@ class NinjaMailerJob implements ShouldQueue
|
|||||||
|
|
||||||
$this->nmo = null;
|
$this->nmo = null;
|
||||||
$this->company = null;
|
$this->company = null;
|
||||||
|
app('queue.worker')->shouldQuit = 1;
|
||||||
$mem_usage = memory_get_usage();
|
|
||||||
|
|
||||||
nlog('The script is now using: ' . round($mem_usage / 1024) . 'KBof memory.');
|
|
||||||
|
|
||||||
} catch (\Exception | \RuntimeException | \Google\Service\Exception $e) {
|
} catch (\Exception | \RuntimeException | \Google\Service\Exception $e) {
|
||||||
|
|
||||||
@ -179,7 +176,6 @@ class NinjaMailerJob implements ShouldQueue
|
|||||||
$message = null;
|
$message = null;
|
||||||
$this->nmo = null;
|
$this->nmo = null;
|
||||||
$this->company = null;
|
$this->company = null;
|
||||||
app('queue.worker')->shouldQuit = 1;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -232,8 +228,34 @@ class NinjaMailerJob implements ShouldQueue
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(Ninja::isSelfHost())
|
||||||
|
$this->setSelfHostMultiMailer();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function setSelfHostMultiMailer()
|
||||||
|
{
|
||||||
|
|
||||||
|
if (env($this->company->id . '_MAIL_HOST'))
|
||||||
|
{
|
||||||
|
|
||||||
|
config([
|
||||||
|
'mail.mailers.smtp' => [
|
||||||
|
'transport' => 'smtp',
|
||||||
|
'host' => env($this->company->id . '_MAIL_HOST'),
|
||||||
|
'port' => env($this->company->id . '_MAIL_PORT'),
|
||||||
|
'username' => env($this->company->id . '_MAIL_USERNAME'),
|
||||||
|
'password' => env($this->company->id . '_MAIL_PASSWORD'),
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private function setOfficeMailer()
|
private function setOfficeMailer()
|
||||||
{
|
{
|
||||||
$sending_user = $this->nmo->settings->gmail_sending_user_id;
|
$sending_user = $this->nmo->settings->gmail_sending_user_id;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user