Skip to content

DigitalRockers/posteon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Posteon NPM version

** Pre-alpha version **

Description

A provider indipendent email module, based on mongoDB.

This software is released under the MIT license. See LICENSE for more details

Supported providers

Download and Installation

From the command line

$ npm install posteon

package.json

dependencies: {
  ...
  "": "*$version*",
  ...
}
...

Example use

var posteon = require('posteon');

posteon.init({
	dbs: {
		mongoDB: {
			uri: 'mongodb://localhost/mailer-dev',
			debug: false,
			options: {},
		},
	},
	lockTime: 60 * 1000,
});

var options = {
	provider: {
		name: 'sendgrid',
		apiKey: YOUR_APIKEY
	},
	options: {
		to: {

		}
	}
};

posteon.send(options, function (err, message) {
	...
});

Send options

var options = {
  provider: {
    name: 'sendgrid',
    apiKey: 'YOUR_APIKEY'
  },
  to: [{
    email: '[email protected]',
    name: 'Jack Smith',
    data: {
      name: 'Jack Smith'
    }
    metadata: {
      userId: '1345698abcd'
    }
  }],
  from: {
    name: 'Mailer',
    email: '[email protected]'
  }
  subject: 'Email subject',
  html: '<h1>Html body</h1>',
  text: 'text body',
  attachments: [
    {
      name: 'file.txt',
      content: Buffer,
      contentType: 'text/plain',//MIME Type
    }
  ],
  images: [
    {
      name: 'picture.png',
      content: Buffer,      
    }
  ],
  tags: ['tag_1', 'tag_2'],
  headers: {
    'X-Replay-To': '[email protected]',
  },
  metadata: {
    appId: 'x895r5t',
  },

  //other provider specific options
}

About

Provider indipendent email module

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published