Skip to content

Commit

Permalink
Add support for mailgun API endpoint (#3364)
Browse files Browse the repository at this point in the history
  • Loading branch information
m0uka authored Jun 5, 2021
1 parent b79d6e9 commit 75d254a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=tls
MAIL_FROM=[email protected]
MAILGUN_ENDPOINT=api.mailgun.net
# You should set this to your domain to prevent it defaulting to 'localhost', causing
# mail servers such as Gmail to reject your mail.
#
Expand Down
6 changes: 6 additions & 0 deletions app/Console/Commands/Environment/EmailSettingsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class EmailSettingsCommand extends Command
{--encryption=}
{--host=}
{--port=}
{--endpoint=}
{--username=}
{--password=}';

Expand Down Expand Up @@ -140,6 +141,11 @@ private function setupMailgunDriverVariables()
trans('command/messages.environment.mail.ask_mailgun_secret'),
$this->config->get('services.mailgun.secret')
);

$this->variables['MAILGUN_ENDPOINT'] = $this->option('endpoint') ?? $this->ask(
trans('command/messages.environment.mail.ask_mailgun_endpoint'),
$this->config->get('services.mailgun.endpoint')
);
}

/**
Expand Down
1 change: 1 addition & 0 deletions config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
'mailgun' => [
'domain' => env('MAILGUN_DOMAIN'),
'secret' => env('MAILGUN_SECRET'),
'endpoint' => env('MAILGUN_ENDPOINT')
],

'mandrill' => [
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en/command/messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
'ask_smtp_username' => 'SMTP Username',
'ask_smtp_password' => 'SMTP Password',
'ask_mailgun_domain' => 'Mailgun Domain',
'ask_mailgun_endpoint' => 'Mailgun Endpoint',
'ask_mailgun_secret' => 'Mailgun Secret',
'ask_mandrill_secret' => 'Mandrill Secret',
'ask_postmark_username' => 'Postmark API Key',
Expand Down

0 comments on commit 75d254a

Please sign in to comment.