Adonis Mail Notification Channel
Mail Notification Channel for adonis-notifications.
Installation
- Add package:
$ npm i adonis-mail-notification-channel --save
or
$ yarn add adonis-mail-notification-channel
- Configure mail package.
See mail doc for more information
- Register provider inside the your
start/app.js
file.
const providers = ... 'adonis-mail-notification-channel/providers/MailNotificationChannelProvider' ...
Usage example
// app/Model/User.jsconst Lucid = static { return '@provider:Notifiable' } /** * // email * foo@bar.com * * // email + name * { address: foo@bar.com', name: 'Foo' } * * // Array * [{ address: 'foo@bar.com', name: 'Foo' }] */ { return thisemail } moduleexports = User
// app/Notifications/MyNotification.jsconst MailMessage = { thistext = text } { return 'mail' } { const message = // You can set up configuration in message message message textthistext return message } moduleexports = MyNotification
const Notifications = ...const users = await Userall await Notifications...
Credits
Support
Having trouble? Open an issue!
License
The MIT License (MIT). Please see License File for more information.