MailLift notifications channel for Laravel 5.3
, (*1)
Mailift EOL
Mailift is no longer in operation. As a result, this channel is deprecated., (*2)
This package makes it easy to create MailLift tasks with Laravel 5.3., (*3)
Contents
Installation
You can install the package via composer:, (*4)
``` bash
composer require laravel-notification-channels/maillift, (*5)
### Setting up the MailLift service
Register at [maillift.com](https://maillift.com).
Add your MailLift username and API key to your `config/services.php`:
```php
// config/services.php
...
'maillift' => [
'user' => env('MAILLIFT_USERNAME'),
'key' => env('MAILLIFT_API_KEY'),
],
...
Usage
Now you can use the channel in your via() method inside the notification:, (*6)
``` php
use NotificationChannels\MailLift\MailLiftChannel;
use NotificationChannels\MailLift\MailLiftMessage;
use Illuminate\Notifications\Notification;, (*7)
class ProjectCreated extends Notification
{
public function via($notifiable)
{
return [MailLiftChannel::class];
}, (*8)
public function toMailLift($notifiable)
{
return MailLiftMessage::create('This is my handwritten letter body')
->sender('Laravel Notification Channels'. PHP_EOL . 'Some street 123');
}
}, (*9)
In order to let your notification know which address you want to send the handwritten letter to, add the `routeNotificationForMailLift` method to your Notifiable model.
This method needs to return a string with the recipient address. Use line breaks (\n character) to separate lines in the field.
```php
public function routeNotificationForMailLift()
{
return 'Recipient Name' . PHP_EOL . 'Recipient Address' . PHP_EOL . 'Recipient State / Postal Code';
}
Available methods
-
body(''): Accepts a string value for the MailLift letter body.
-
sender(''): Accepts a string value for the MailLift sender. Use line breaks (\n character) to separate lines in the field.
-
scheduleDelivery(''): Accepts a string or DateTime object for the scheduled delivery date.
Changelog
Please see CHANGELOG for more information what has changed recently., (*10)
Testing
bash
$ composer test, (*11)
Security
If you discover any security related issues, please email m.pociot@gmail.com instead of using the issue tracker., (*12)
Contributing
Please see CONTRIBUTING for details., (*13)
Credits
License
The MIT License (MIT). Please see License File for more information., (*14)