mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 19:24:40 -04:00
Updates for mailgun
This commit is contained in:
parent
2e51bbd655
commit
41daa63056
@ -258,9 +258,11 @@ class NinjaMailerJob implements ShouldQueue
|
|||||||
switch ($this->nmo->settings->email_sending_method) {
|
switch ($this->nmo->settings->email_sending_method) {
|
||||||
case 'default':
|
case 'default':
|
||||||
$this->mailer = config('mail.default');
|
$this->mailer = config('mail.default');
|
||||||
|
// $this->setHostedMailgunMailer(); //should only be activated if hosted platform needs to fall back to mailgun
|
||||||
break;
|
break;
|
||||||
case 'mailgun':
|
case 'mailgun':
|
||||||
$this->mailer = 'mailgun';
|
$this->mailer = 'mailgun';
|
||||||
|
$this->setHostedMailgunMailer();
|
||||||
break;
|
break;
|
||||||
case 'gmail':
|
case 'gmail':
|
||||||
$this->mailer = 'gmail';
|
$this->mailer = 'gmail';
|
||||||
@ -368,6 +370,21 @@ class NinjaMailerJob implements ShouldQueue
|
|||||||
return $user;
|
return $user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function setHostedMailgunMailer()
|
||||||
|
{
|
||||||
|
|
||||||
|
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
|
||||||
|
->mailable
|
||||||
|
->from(config('services.mailgun.from.address'), $email_from_name);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configures Mailgun using client supplied secret
|
* Configures Mailgun using client supplied secret
|
||||||
* as the Mailer
|
* as the Mailer
|
||||||
|
@ -463,6 +463,21 @@ class Email implements ShouldQueue
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function setHostedMailgunMailer()
|
||||||
|
{
|
||||||
|
|
||||||
|
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->mailable
|
||||||
|
->from(config('services.mailgun.from.address'), $email_from_name);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the mail driver to use and applies any specific configuration
|
* Sets the mail driver to use and applies any specific configuration
|
||||||
* the the mailable
|
* the the mailable
|
||||||
@ -472,9 +487,11 @@ class Email implements ShouldQueue
|
|||||||
switch ($this->email_object->settings->email_sending_method) {
|
switch ($this->email_object->settings->email_sending_method) {
|
||||||
case 'default':
|
case 'default':
|
||||||
$this->mailer = config('mail.default');
|
$this->mailer = config('mail.default');
|
||||||
|
// $this->setHostedMailgunMailer(); //should only be activated if hosted platform needs to fall back to mailgun
|
||||||
break;
|
break;
|
||||||
case 'mailgun':
|
case 'mailgun':
|
||||||
$this->mailer = 'mailgun';
|
$this->mailer = 'mailgun';
|
||||||
|
$this->setHostedMailgunMailer();
|
||||||
break;
|
break;
|
||||||
case 'gmail':
|
case 'gmail':
|
||||||
$this->mailer = 'gmail';
|
$this->mailer = 'gmail';
|
||||||
|
@ -24,6 +24,10 @@ return [
|
|||||||
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
|
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
|
||||||
'webhook_signing_key' => env('MAILGUN_WEBHOOK_SIGNING_KEY', ''),
|
'webhook_signing_key' => env('MAILGUN_WEBHOOK_SIGNING_KEY', ''),
|
||||||
'scheme' => 'https',
|
'scheme' => 'https',
|
||||||
|
'from' => [
|
||||||
|
'address' => env('MAILGUN_FROM_ADDRESS', ''),
|
||||||
|
'name' => env('MAILGUN_FROM_NAME', ''),
|
||||||
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
'postmark' => [
|
'postmark' => [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user