Go to file
Loann e619f68be8 Modifying Readme 2020-04-09 17:57:21 +02:00
config Modifying readme and api files 2020-04-09 17:43:19 +02:00
src Modifying readme and api files 2020-04-09 17:43:19 +02:00
.gitignore Adding Guzzle 2020-04-09 10:56:55 +02:00
README.md Modifying Readme 2020-04-09 17:57:21 +02:00
composer.json Modifying composer.json 2020-04-09 16:09:23 +02:00
composer.lock Adding Guzzle 2020-04-09 10:56:55 +02:00

README.md

BMail

The BMail package allows you to send email templates on Laravel to the Bluescale API.

Installation

First in your composer.json, add :

"require": {
        "bluescale/laravel-bmail": "dev-master"
    }

and

"repositories": [
        {
            "type": "vcs",
            "url": "git@git.bluesquare.io:bluescale/laravel-bmail.git"
        }
    ]

Next update your package :

composer update bluescale/laravel-bmail

Then publish the assets from your provider :

php artisan vendor:publish

Finally add your API key in the .env :

BMAIL_API_KEY=your_key
BMAIL_API_URL=the_api_url

Usage

$template = (new BMailTemplate("** template_id **"))
    ->sender("john.doe@gmail.com", 'John')
    ->replyTo("jean.grey@gmail.com", 'Jean')
    ->recipients([
        ['elvis@gmail.com', ['name' => 'Elvis']],
        ['matthew@gmail.com', ['name' => 'Matthew', 'parameters' => ['key' => 'value']]
    ])
    ->addRecipient('edward@gmail.com')
    ->addRecipient("robert@gmail.com", ['name' => 'Rob', 'parameters' => ['key' => 'value']])
    ->parameters(['foo' => 'bar', 'foo' => 'fighter'])
    ->addParameter('key', 'value');
return (new BMailApi(config('bmail.api_key')))->send($template);