Updates for custom designs

This commit is contained in:
David Bomba 2024-03-05 16:06:02 +11:00
parent 6859de6e8c
commit 6f80c6fab8
6 changed files with 24 additions and 9 deletions

View File

@ -279,9 +279,15 @@ class NinjaMailerJob implements ShouldQueue
$this->mailer = 'postmark'; $this->mailer = 'postmark';
$this->client_postmark_secret = config('services.postmark-outlook.token'); $this->client_postmark_secret = config('services.postmark-outlook.token');
if (property_exists($this->nmo->settings, 'email_from_name') && strlen($this->nmo->settings->email_from_name) > 1) {
$email_from_name = $this->nmo->settings->email_from_name;
} else {
$email_from_name = $this->company->present()->name();
}
$this->nmo $this->nmo
->mailable ->mailable
->from('maildelivery@invoice.services', 'Invoice Ninja'); ->from(config('services.postmark-outlook.from.address'), $email_from_name);
return $this; return $this;
} }

View File

@ -36,11 +36,11 @@ class RouteServiceProvider extends ServiceProvider
{ {
parent::boot(); parent::boot();
if (Ninja::isHosted() && !config('ninja.testvars.travis')) { // if (Ninja::isHosted() && !config('ninja.testvars.travis')) {
app('router')->aliasMiddleware('throttle', ThrottleRequestsWithPredis::class); // app('router')->aliasMiddleware('throttle', ThrottleRequestsWithPredis::class);
} else { // } else {
app('router')->aliasMiddleware('throttle', ThrottleRequests::class); app('router')->aliasMiddleware('throttle', ThrottleRequests::class);
} // }
Route::bind('task_scheduler', function ($value) { Route::bind('task_scheduler', function ($value) {
if (is_numeric($value)) { if (is_numeric($value)) {

View File

@ -503,13 +503,19 @@ class Email implements ShouldQueue
$server = $dns[0]["target"]; $server = $dns[0]["target"];
if(stripos($server, "outlook.com") !== false) { if(stripos($server, "outlook.com") !== false) {
if (property_exists($this->email_object->settings, 'email_from_name') && strlen($this->email_object->settings->email_from_name) > 1) {
$email_from_name = $this->email_object->settings->email_from_name;
} else {
$email_from_name = $this->company->present()->name();
}
$this->mailer = 'postmark'; $this->mailer = 'postmark';
$this->client_postmark_secret = config('services.postmark-outlook.token'); $this->client_postmark_secret = config('services.postmark-outlook.token');
$this->mailable $this->mailable
->from('maildelivery@invoice.services', 'Invoice Ninja'); ->from(config('services.postmark-outlook.from.address'), $email_from_name);
return $this; return $this;
} }
} catch(\Exception $e) { } catch(\Exception $e) {
nlog("problem switching outlook driver - hosted"); nlog("problem switching outlook driver - hosted");

View File

@ -35,7 +35,10 @@ return [
], ],
'postmark-outlook' => [ 'postmark-outlook' => [
'token' => env('POSTMARK_OUTLOOK_SECRET','') 'token' => env('POSTMARK_OUTLOOK_SECRET',''),
'from' => [
'address' => env('POSTMARK_OUTLOOK_FROM_ADDRESS', '')
],
], ],
'microsoft' => [ 'microsoft' => [

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long