North Pittsburgh Meatpackers

hapi-mailin

0.2.3 • Public • Published

hapi-mailin

Artisanal inbound emails for hapi

Install

npm install --save hapi-mailin

Usage

var mailinOpts = {
  port: 25,
  webhook: 'http://localhost:8100/api/emails',
};
 
server.pack.register({
  plugin: require('hapi-mailin'),
  options: mailinOpts
}, function(err) {
  server.plugins['hapi-mailin'].mailin.on("authorizeUser", function(connection, username, password, done) {
    if (username == "demo" && password == "demo") {
      done(null, true);
    } else {
      done(new Error("Unauthorized!"), false)
    }
  });
 
  server.plugins['hapi-mailin'].mailin.on("message", function(connection, data, content) {
    // do something with data
  }
});

install

npm i hapi-mailin

Downloadsweekly downloads

4

version

0.2.3

license

MIT License

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability