From 88eab63449a141b4fb87a8cf2da5bf9198af240f Mon Sep 17 00:00:00 2001 From: Loann Meignant Date: Thu, 9 Apr 2020 17:43:19 +0200 Subject: [PATCH] Modifying readme and api files --- README.md | 15 +++++++++++---- config/bmail.php | 3 ++- src/BMailApi.php | 5 +---- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 63d4e22..ed9a5c4 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ The BMail package allows you to send email templates on Laravel to the Bluescale ## Usage -In your composer.json, add : +First in your composer.json, add : ```bash "require": { @@ -23,16 +23,23 @@ and ] ``` -Then update your package file : +Next update your package : ```bash -composer update bluescale/laravel-mail +composer update bluescale/laravel-bmail ``` -Finally publish the assets from your provider : +Then publish the assets from your provider : ```bash php artisan vendor:publish ``` +Finally add your API key in the .env : + +```bash +BMAIL_API_KEY=your_key +BMAIL_API_URL=the_api_url +``` + diff --git a/config/bmail.php b/config/bmail.php index b46bd67..80a3ec7 100644 --- a/config/bmail.php +++ b/config/bmail.php @@ -2,6 +2,7 @@ return [ - 'bmail' => env('BMAIL_KEY', null) + 'api_key' => env('BMAIL_API_KEY', null), + 'api_url' => env('BMAIL_API_URL', null) ]; diff --git a/src/BMailApi.php b/src/BMailApi.php index 8232742..58547d0 100644 --- a/src/BMailApi.php +++ b/src/BMailApi.php @@ -22,10 +22,7 @@ class BMailApi public function send($template) { - $url = "http://127.0.0.1:9000/api/project/template/send"; - - // TODO -// $url = "http://127.0.0.1:9000/api/project/template/send"; + $url = config('bmail.api_url'); $client = new Client();