Skip to content

Commit 75d254a

Browse files
authored
Add support for mailgun API endpoint (pterodactyl#3364)
1 parent b79d6e9 commit 75d254a

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ MAIL_USERNAME=
2525
MAIL_PASSWORD=
2626
MAIL_ENCRYPTION=tls
2727
MAIL_FROM=no-reply@example.com
28+
MAILGUN_ENDPOINT=api.mailgun.net
2829
# You should set this to your domain to prevent it defaulting to 'localhost', causing
2930
# mail servers such as Gmail to reject your mail.
3031
#

app/Console/Commands/Environment/EmailSettingsCommand.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class EmailSettingsCommand extends Command
3737
{--encryption=}
3838
{--host=}
3939
{--port=}
40+
{--endpoint=}
4041
{--username=}
4142
{--password=}';
4243

@@ -140,6 +141,11 @@ private function setupMailgunDriverVariables()
140141
trans('command/messages.environment.mail.ask_mailgun_secret'),
141142
$this->config->get('services.mailgun.secret')
142143
);
144+
145+
$this->variables['MAILGUN_ENDPOINT'] = $this->option('endpoint') ?? $this->ask(
146+
trans('command/messages.environment.mail.ask_mailgun_endpoint'),
147+
$this->config->get('services.mailgun.endpoint')
148+
);
143149
}
144150

145151
/**

config/services.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
'mailgun' => [
1717
'domain' => env('MAILGUN_DOMAIN'),
1818
'secret' => env('MAILGUN_SECRET'),
19+
'endpoint' => env('MAILGUN_ENDPOINT')
1920
],
2021

2122
'mandrill' => [

resources/lang/en/command/messages.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
'ask_smtp_username' => 'SMTP Username',
5454
'ask_smtp_password' => 'SMTP Password',
5555
'ask_mailgun_domain' => 'Mailgun Domain',
56+
'ask_mailgun_endpoint' => 'Mailgun Endpoint',
5657
'ask_mailgun_secret' => 'Mailgun Secret',
5758
'ask_mandrill_secret' => 'Mandrill Secret',
5859
'ask_postmark_username' => 'Postmark API Key',

0 commit comments

Comments
 (0)