Skip to content

Commit

Permalink
Update readme, and ServiceProvider tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-thomas committed Oct 27, 2015
1 parent 2b45b53 commit ebebce0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 15 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ A very basic Laravel wrapper for the [Dotmailer API Client](https://github.com/r

To install, inside your project directory run the following from your terminal:

composer require "industrious-mouse/laravel-dotmailer": "dev-master"
composer require industrious-mouse/laravel-dotmailer

Then load the service provider in your config/app.php:

IndustriousMouse\LaravelDotmailer\LaravelDotmailerServiceProvider::class

You'll also need to publish the config, so you can provide your keys:

php artisan vendor:publish --provider="IndustriousMouse\LaravelDotmailer\LaravelDotmailerServiceProvider"

## Examples

Expand All @@ -23,7 +31,7 @@ To install, inside your project directory run the following from your terminal:
]
]
]);

try
{
$contact = Dotmailer::PostContacts($contact_data);
Expand All @@ -32,7 +40,7 @@ To install, inside your project directory run the following from your terminal:
{
return $e;
}

### Sending a Campaign to a contact


Expand Down
4 changes: 2 additions & 2 deletions config/dotmailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

return [

'username' => '',
'password' => ''
'username' => env('DOTMAILER_USERNAME'),
'password' => env('DOTMAILER_PASSWORD')

];
22 changes: 12 additions & 10 deletions src/LaravelDotmailerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,14 @@
*/
class LaravelDotmailerServiceProvider extends ServiceProvider {

/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;

/**
* Boot the service provider.
*
* @return void
*/
public function boot()
{
$this->publishes([
__DIR__.'/../config/dotmailer.php' => config_path('dotmailer.php'),
]);
$this->registerConfig();
}

/**
Expand Down Expand Up @@ -58,4 +49,15 @@ public function provides()
{
return [];
}

/**
* Registers Configuration
*/
private function registerConfig()
{
$configPath = __DIR__ . '/../config/dotmailer.php';

$this->publishes([$configPath => config_path('dotmailer.php')], 'dotmailer');
$this->mergeConfigFrom($configPath, 'dotmailer');
}
}

0 comments on commit ebebce0

Please sign in to comment.