0.2.3 • Published 9 years ago

hapi-mailin v0.2.3

Weekly downloads
1
License
MIT License
Repository
github
Last release
9 years ago

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
  }
});
0.2.3

9 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago