# Beautymail for Laravel 5 Beautymail makes it super easy to send beautiful responsive HTML emails. It's made for things like: * Welcome emails * Password reminders * Invoices * Data exports If you're on Laravel 4, use the `1.x` branch. ## Templates There are tons of great looking HTML email templates out there. Campaign Monitor and Mailchimp has released hundreds for free. It is pretty simple to adapt a template to Beautymail. If you do, please send a PR. __Widgets__ by [Campaign Monitor](https://www.campaignmonitor.com/templates/all/):  __Minty__ by __Stamplia__:  __Sunny__  ## Installation Add the package to your `composer.json` by running: composer require snowfire/beautymail dev-master When it's installed, add it to the providers list in `config/app.php` Snowfire\Beautymail\BeautymailServiceProvider::class, Publish assets to your public folder php artisan vendor:publish --provider="Snowfire\Beautymail\BeautymailServiceProvider" Configure your settings such as logo url and social links in `config/beautymail.php` ## Send your first Beauty mail Add this to your `routes.php` ```php Route::get('/test', function() { $beautymail = app()->make(Snowfire\Beautymail\Beautymail::class); $beautymail->send('emails.welcome', [], function($message) { $message ->from('bar@example.com') ->to('foo@example.com', 'John Smith') ->subject('Welcome!'); }); }); ``` Now create `resources/views/emails/welcome.blade.php` ```html @extends('beautymail::templates.widgets') @section('content') @include('beautymail::templates.widgets.articleStart')
This is a test
@include('beautymail::templates.widgets.articleEnd') @include('beautymail::templates.widgets.newfeatureStart')This is another test
@include('beautymail::templates.widgets.newfeatureEnd') @stop ``` That's it! ## Options ### _Template:_ Widgets To change colours for the different segments, pass a colour variable: ```php @include('beautymail::templates.widgets.articleStart', ['color' => '#0000FF']) ``` #### Minty template example ```html @extends('beautymail::templates.minty') @section('content') @include('beautymail::templates.minty.contentStart')This is a test
@include('beautymail::templates.ark.contentEnd') @include('beautymail::templates.ark.heading', [ 'heading' => 'Another headline', 'level' => 'h2' ]) @include('beautymail::templates.ark.contentStart')This is another test
@include('beautymail::templates.ark.contentEnd') @stop ``` #### Sunny template example ```html @extends('beautymail::templates.sunny') @section('content') @include ('beautymail::templates.sunny.heading' , [ 'heading' => 'Hello!', 'level' => 'h1', ]) @include('beautymail::templates.sunny.contentStart')Today will be a great day!
@include('beautymail::templates.sunny.contentEnd') @include('beautymail::templates.sunny.button', [ 'title' => 'Click me', 'link' => 'http://google.com' ]) @stop ```