Ra Notification NodeJS Client
const raNotificationClient = require ( 'ra-notification-nodejs-client' ) ;
const mail = {
From : "no-reply@example.com" ,
To : [ "example@example.com" ] ,
Cc : [ ] ,
Bcc : [ ] ,
Subject : "RaNotification Released!" ,
Body : "Hi all, we're pleased to announce that RaNotification is released." ,
IsHtml : false
} ;
// send basic email
raNotificationClient
. sendEmail ( mail )
. then ( ( ) => {
console . log ( 'Success' ) ;
} )
. catch ( err => {
console . log ( 'Failure: ' , err ) ;
} ) ;
Send HTML formatted email
const raNotificationClient = require ( 'ra-notification-nodejs-client' ) ;
const mail = {
From : "no-reply@example.com" ,
To : [ "example@example.com" ] ,
Cc : [ ] ,
Bcc : [ ] ,
Subject : "RaNotification Released!"
} ;
raNotificationClient
. sendHtmlEmail ( mail , 'C:\\email-template.html' )
. then ( ( ) => {
console . log ( 'Success' ) ;
} )
. catch ( err => {
console . log ( 'Failure: ' , err ) ;
} ) ;
< ul >
< li > Hello</ li >
< li > World</ li >
</ ul >
const raNotificationClient = require ( 'ra-notification-nodejs-client' ) ;
const mail = {
From : "no-reply@example.com" ,
To : [ "example@example.com" ] ,
Cc : [ ] ,
Bcc : [ ] ,
Subject : "RaNotification Released!" ,
Body : "Hi all, we're pleased to announce that RaNotification is released." ,
IsHtml : false
} ;
// send basic email
raNotificationClient
. addAttachment ( 'a.txt' , 'C:\\a.txt' )
. addAttachment ( 'note.txt' , 'C:\\b.txt' )
. sendEmail ( mail )
. then ( ( ) => {
console . log ( 'Success' ) ;
} )
. catch ( err => {
console . log ( 'Failure: ' , err ) ;
} ) ;