This package makes it easy to send notifications using Mailingwork with Laravel 5.3.
This is where your description should go. Add a little code example so build can understand real quick how the package can be used. Try and limit it to a paragraph or two.
Since the package is under development and not published in official laravel-notification-channels repository, you need to define custom repository to install it from current repository.
Add following repository to your composer.json
file.
"repositories": [
{
"type": "vcs",
"url": "[email protected]:ironsharkde/laravel-notification-mailingwork.git"
}
],
Now you can install the package via composer:
composer require laravel-notification-channels/mailingwork dev-master
You must install the service provider:
// config/app.php
'providers' => [
...
NotificationChannels\Mailingwork\MailingworkServiceProvider::class,
],
You will need a mailingworks account in order to use this channel.
Place your credentails and configs inside your .env
file,
or create custom config/mailingwork.php
file based on this file:
MAILINGWORK_USERNAME=username
MAILINGWORK_PASSWORD=pass
[email protected]
MAILINGWORK_FROM_NAME=Postmaster
You can now use the channel in your via()
method inside the Notification class.
use Illuminate\Notifications\Notification;
use NotificationChannels\Mailingwork\MailingworkChannel;
use NotificationChannels\Mailingwork\MailingworkMessage;
class InvoicePaid extends Notification
{
public function via($notifiable)
{
return [MailingworkChannel::class];
}
public function toMailingwork($notifiable)
{
return (new MailingworkMessage)
->to($notifiable->email)
->line('The introduction to the notification.')
->action('Notification Action', 'https://laravel.com')
->line('Thank you for using our application!');
}
}
to($address)
: (string) Recipient's email address.subject($subject)
: (string) Set the subject of the notification.greeting($greeting)
: (string) Set the greeting of the notification.line($address)
: (string) Add a line of text to the notification.action($text, $url)
: (string) Configure the "call to action" button.level($level)
: (string) Set the "level" of the notification (success, error, etc.).
Please see CHANGELOG for more information what has changed recently.
$ composer test
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.