Skip to content
This repository has been archived by the owner on Dec 22, 2019. It is now read-only.

Commit

Permalink
Merge pull request #111 from bul-ikana/master
Browse files Browse the repository at this point in the history
Load config values from env
  • Loading branch information
imadphp committed Mar 27, 2018
2 parents 85dd0ac + 20b7db8 commit 55b1fe5
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 10 deletions.
56 changes: 55 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,61 @@ Next, publish the config file with the following `artisan` command.<br />
php artisan vendor:publish --provider="Bogardo\Mailgun\MailgunServiceProvider" --tag="config"
```

After publishing, configure the package in `config/mailgun.php`.
After publishing, add and fill the next values to your [`.env` file](https://laravel.com/docs/configuration#environment-configuration)

```bash
# Domain name registered with Mailgun
MAILGUN_DOMAIN=

# Mailgun (private) API key
MAILGUN_PRIVATE=

# Mailgun public API key
MAILGUN_PUBLIC=

# You may wish for all e-mails sent with Mailgun to be sent from
# the same address. Here, you may specify a name and address that is
# used globally for all e-mails that are sent by this application through Mailgun.
MAILGUN_FROM_ADDRESS=
MAILGUN_FROM_NAME=

# Global reply-to e-mail address
MAILGUN_REPLY_TO=

# Force the from address
#
# When your `from` e-mail address is not from the domain specified some
# e-mail clients (Outlook) tend to display the from address incorrectly
# By enabling this setting, Mailgun will force the `from` address so the
# from address will be displayed correctly in all e-mail clients.
#
# WARNING:
# This parameter is not documented in the Mailgun documentation
# because if enabled, Mailgun is not able to handle soft bounces
MAILGUN_FORCE_FROM_ADDRESS=

# Testing
#
# Catch All address
#
# Specify an email address that receives all emails send with Mailgun
# This email address will overwrite all email addresses within messages
MAILGUN_CATCH_ALL=

# Testing
#
# Mailgun's testmode
#
# Send messages in test mode by setting this setting to true.
# When you do this, Mailgun will accept the message but will
# not send it. This is useful for testing purposes.
#
# Note: Mailgun DOES charge your account for messages sent in test mode.
MAILGUN_TESTMODE=

```

You can also configure the package in your `config/mailgun.php`.


### HTTP Client Dependency
Expand Down
18 changes: 9 additions & 9 deletions config/mailgun.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
* Domain name registered with Mailgun
*
*/
'domain' => '',
'domain' => env('MAILGUN_DOMAIN', ''),

/*
* Mailgun (private) API key
*
*/
'api_key' => '',
'api_key' => env('MAILGUN_PRIVATE', ''),

/*
* Mailgun public API key
*
*/
'public_api_key' => '',
'public_api_key' => env('MAILGUN_PUBLIC', ''),

/*
* You may wish for all e-mails sent with Mailgun to be sent from
Expand All @@ -37,15 +37,15 @@
*
*/
'from' => [
'address' => '',
'name' => ''
'address' => env('MAILGUN_FROM_ADDRESS', ''),
'name' => env('MAILGUN_FROM_NAME', ''),
],

/*
* Global reply-to e-mail address
*
*/
'reply_to' => '',
'reply_to' => env('MAILGUN_REPLY_TO', ''),

/*
* Force the from address
Expand All @@ -60,7 +60,7 @@
* because if enabled, Mailgun is not able to handle soft bounces
*
*/
'force_from_address' => false,
'force_from_address' => env('MAILGUN_FORCE_FROM_ADRESS', false),

/*
* Testing
Expand All @@ -70,7 +70,7 @@
* Specify an email address that receives all emails send with Mailgun
* This email address will overwrite all email addresses within messages
*/
'catch_all' => "",
'catch_all' => env('MAILGUN_CATCH_ALL', ''),

/*
* Testing
Expand All @@ -83,5 +83,5 @@
*
* Note: Mailgun DOES charge your account for messages sent in test mode.
*/
'testmode' => false
'testmode' => env('MAILGUN_TESTMODE', false)
];

0 comments on commit 55b1fe5

Please sign in to comment.