Node package for the Notifications Manager
Available functions
- new: creates a notification
- new_simple_with_email: creates a simple user notification that includes email
- new_auth_simple_with_email: creates a simple user notification that includes email
- new_automatic: Creates a notification based on template
Test
npm run test
or
docker build -t gid_notifications .
docker run -it gid_notifications bash -c "npm run test"
Deploy
- Update package number
npm publish
Usage
$ npm install gid-notifications
const notifications-service = require( 'gid-notifications');
notifications-service.init( dama_jwt);
// just a notification, requires init()
notifications-service.new( receiver_id, type, title, message, link, code, severity, tags, expiry, session_id, email_template, email_params);
// a notification and send an email using a template, requires init()
notifications-service.new_simple_with_email( receiver_id, type, title, message, link, code, severity, tags, expiry, session_id, email_template, email_params);
// init + new_simple_with_email
notifications-service.new_auth_simple_with_email( dama_jwt, receiver_id, type, title, message, link, code, severity, tags, expiry, session_id, email_template, email_params);
// look for more examples in test/test.js