Socket
Socket
Sign inDemoInstall

nodemailer-unione-transport

Package Overview
Dependencies
47
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    nodemailer-unione-transport

A transport module to use with nodemailer to leverage UniOne's REST API (http://www.unisender.com/?a=opencart)


Version published
Weekly downloads
35
decreased by-16.67%
Maintainers
1
Install size
3.69 MB
Created
Weekly downloads
 

Readme

Source

nodemailer-unione-transport

Что это?

nodemailer - это самый популярный node.js модуль для рассылки Email. А это transport-плагин, который позволят nodemailer'у отправлять письма через сервис почтовых рассылок UniOne. Сервис позволит вам не только осуществлять массовую рассылку без риска попасть в черный список SMTP, но и отслеживать доставку ваших писем.

Пример использования

var nodemailer = require('nodemailer');
var unione = require('unione-transport');

var options = {
    auth: {
        api_key: 'Уникальный API-ключ пользователя UniOne',
        username: 'Логин пользователя в системе'
    }
}

var nodemailerUnione = unione.createTransport(options);

nodemailerUnione.sendMail({
    from_email: 'myemail@example.com',  //Обратные адреса нужно зарегистрировать и подтвердить в Личном кабинете, или через API
    from_name: 'John Dow',              //Необязательный параметр
    recipients: [                       //До 500 адрессатов
        {
            "email": "some_email@domain.com"
            "substitutions":            //Необязательный параметр
            {
              "userName": "Ivan",
              "to_name": "Ivan Petrov"
            }
        },
        {
            "email": "other_email@domain.com"
            "substitutions": 
            {
              "userName": "Nina",
              "to_name": "Nina Pavlova"
            }
        }
    ],
    subject: '{{userName}}, you are awesome!',  //Всесто {{userName}} подставится строка из substitutions
    body:
        {
          "html": "<b>Hello, {{userName}}</b>", //Должен присутствовать хотя бы один из параметров
          "plaintext": "Hello, {{userName}}"
        },
    metadata:                                   //Необязательный параметр
        {
            "mailId" : "3423452345234234"       //Эти параметры будут переданы в Webhook
        }
}, function (err, info) {
    if (err) {
        console.log('Error: ' + err);
    }
    else {
        console.log('Response: ' + info);
    }
});

Keywords

FAQs

Last updated on 20 Mar 2018

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