Socket
Socket
Sign inDemoInstall

upnode-cluster-smtp

Package Overview
Dependencies
23
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    upnode-cluster-smtp

Provides 2 pluggable RPC calls: one generates smtp pool, and the other is responsible for generating smtp access credentials cache


Version published
Weekly downloads
8
increased by300%
Maintainers
1
Install size
6.08 MB
Created
Weekly downloads
 

Readme

Source

Upnode cluster smtp extension

Plugin for upnode-cluster, adds methods for handling distributed email messaging

Install

npm install upnode-cluster upnode-cluster-smtp -S

Usage

var Node = require('upnode-cluster');
var SMTPResources = require('upnode-cluster-smtp');
var resources = {};

SMTPResources.init(resources, {
    gmail_oauth_appid: {
        clientId: '',
        clientSercret: ''
    }
}, function prepareEmail(rawNodemailerOpts) {
    // will be preprocessed on the node locally
});

var node = new Node({
    // ...
    resources: resources
});

// then you can use it

var opts = {
    provider: 'gmail',
    user: 'support@ark.com',
    type: 'oauth',
    credentialsResourceName: 'gmail_oauth_appid',
    credentials: {
        refreshToken: '<refresh token>',
        accessToken: '<access token>'
    }
};

var self = this;
var nodeId = this.node.server.id;
node.acquireResource('email@example.com', 'SMTP', opts).then(function (resourceHolderId) {
    var nodemailerOpts = {}; // whatever nodemailer accepts
    return self.callResource(resourceHolderId, 'email@example.com', 'SMTP', { email: nodemailerOpts, options: opts });
}).nodeify(function (err, response) {
    // either that or promises
});

Keywords

FAQs

Last updated on 12 May 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc