2.0.1 • Published 7 years ago

we-plugin-notification v2.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

We.js Notification plugin

Send notifications to your users, this plugin is inspired in github notifications

Installation:

we i we-plugin-notification

API:

Authenticated user notifications is avaible at /notification page or API endpoint

How to register one new notification:

// after create register one notifications
we.db.models.notification.create({
  locale: res.locals.locale,
  // use i18n to localize your notification title after save like in this example
  title: res.locals.__('post.image.create.notification.title'),
  // text related to your notification, may be one teaser
  text: 'bla, bla, bla ... text here',
  // this url is used to redirect use to related content
  // add hostname for compatibility with emails
  redirectUrl: hostname+'/post/'+record.id,
  // user id of user how will be notified
  userId: 10,
  // user how did the notified action, optional
  actorId: actor.id,
  // model name, optional
  modelName: 'post',
  // model id, optional  
  modelId: record.id,
  // type may be used for show icons or 
  // custom css in your notification
  type: 'post-created-in-group'
}).then(function (r) {
  // done!
  // continue with your logic here ...
}).catch(done);

URLs

See plugin.js file

NPM Info:

NPM

License

the MIT license.

2.0.1

7 years ago

2.0.0

7 years ago

1.1.1

8 years ago

1.1.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.3.1

9 years ago

0.3.0

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.0.11

11 years ago

0.0.10

11 years ago

0.0.9

11 years ago

0.0.8

11 years ago

0.0.7

11 years ago

0.0.6

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago