iitg-webmail-notify
A module for getting event based notifications containing new webmail for IITG webmail servers.
Installation
$ npm install iitg-webmail-notify
Usage
### Example
var Webmail = ;... // Store user details in an objectvar userDetails = username : username // Without @iitg.ernet.in password : password mailServer: mailServer // Among 'teesta', 'disang', 'naambor', 'tamdil', 'dikrong' path: '' // specify relative folder where to save attachments // defaults to folder where this is called from debug: true // for extra output, defaults to false ; // Create new Webmail objectwebmail = user; // Pass a callback which will be called// when a new mail is recevied in user's// inbox. mail is an object as described below.webmail // Catch error event.webmail...
Data types
- mail is an object representing the newly received webmail, and has the following properties:
- from - object - The sender of the mail. Contains two entries.
- email - string - The email of the sender
- name - string - The name of the sender
- to - array - The receivers of the mail. Each entry is an object with email and name, as described above.
- date - date - The internal server date for the mail.
- subject - string - The subject of the mail.
- text - string - Plain text body of the mail.
- textAsHtml - string - The plaintext body of the message formatted as HTML.
- attachments - array - Array of objects containing name and path of each attachment.
- from - object - The sender of the mail. Contains two entries.
TODO
- Attachments
- Filtering
- Tests
License
The MIT License (MIT). Please see License File for more information.