Fixes for invoiceemailengine

This commit is contained in:
David Bomba 2023-02-15 23:09:27 +11:00
parent 8d0b9fef1f
commit 329d3595ba
3 changed files with 5 additions and 12 deletions

View File

@ -138,8 +138,6 @@ class NinjaMailerJob implements ShouldQueue
$mailer->mailgun_config($this->client_mailgun_secret, $this->client_mailgun_domain); $mailer->mailgun_config($this->client_mailgun_secret, $this->client_mailgun_domain);
} }
nlog($this->nmo->to_user->email);
$mailer $mailer
->to($this->nmo->to_user->email) ->to($this->nmo->to_user->email)
->send($this->nmo->mailable); ->send($this->nmo->mailable);
@ -395,9 +393,8 @@ nlog($this->nmo->to_user->email);
* as the Mailer * as the Mailer
*/ */
private function setPostmarkMailer() private function setPostmarkMailer()
{nlog("configuring postmark"); {
if(strlen($this->nmo->settings->postmark_secret) > 2){ if(strlen($this->nmo->settings->postmark_secret) > 2){
nlog($this->nmo->settings->postmark_secret);
$this->client_postmark_secret = $this->nmo->settings->postmark_secret; $this->client_postmark_secret = $this->nmo->settings->postmark_secret;
} }
else{ else{
@ -409,8 +406,7 @@ nlog($this->nmo->to_user->email);
$sending_email = (isset($this->nmo->settings->custom_sending_email) && stripos($this->nmo->settings->custom_sending_email, "@")) ? $this->nmo->settings->custom_sending_email : $user->email; $sending_email = (isset($this->nmo->settings->custom_sending_email) && stripos($this->nmo->settings->custom_sending_email, "@")) ? $this->nmo->settings->custom_sending_email : $user->email;
$sending_user = (isset($this->nmo->settings->email_from_name) && strlen($this->nmo->settings->email_from_name) > 2) ? $this->nmo->settings->email_from_name : $user->name(); $sending_user = (isset($this->nmo->settings->email_from_name) && strlen($this->nmo->settings->email_from_name) > 2) ? $this->nmo->settings->email_from_name : $user->name();
nlog($sending_email);
nlog($sending_user);
$this->nmo $this->nmo
->mailable ->mailable
->from($sending_email, $sending_user); ->from($sending_email, $sending_user);
@ -653,9 +649,6 @@ nlog($sending_user);
public function failed($exception = null) public function failed($exception = null)
{ {
if($exception)
nlog($exception->getMessage());
config(['queue.failed.driver' => null]); config(['queue.failed.driver' => null]);
} }

View File

@ -213,8 +213,8 @@ class InvoiceEmailEngine extends BaseEmailEngine
} }
} }
}
return $this; return $this;
} }
} }
}

View File

@ -94,7 +94,7 @@ class AppServiceProvider extends ServiceProvider
}); });
Mailer::macro('postmark_config', function (string $postmark_key) { Mailer::macro('postmark_config', function (string $postmark_key) {
nlog($postmark_key);
Mailer::setSymfonyTransport(app('mail.manager')->createSymfonyTransport([ Mailer::setSymfonyTransport(app('mail.manager')->createSymfonyTransport([
'transport' => 'postmark', 'transport' => 'postmark',
'token' => $postmark_key 'token' => $postmark_key