Socket
Book a DemoInstallSign in
Socket

prodperfect-mailsac

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prodperfect-mailsac

A mailsac wrapper package for prodperfect

0.0.9
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

prodperfect-mailsac

Node library for interacting with Mailsac mail platform

Core features/methods

  • createEmailAddress(customerName: String): create email address

  • getInbox(subjectQuery: String, t): get mails in inbox

  • getMail(mailId: String, deleteMail: Boolean, mode: 'dirty' or 'text'): get content of an mail

  • deleteMail(mailId: String): delete a mail

  • getAll(t, size=20: integer): returns last n-size mails

Quick example

ES6

import MailBox from 'prodperfect-mailsac';

// create an instance of the mailBox
const newMailBox = new MailBox();

// generate a new (random) email address. replace customerName with the name of the customer
const emailAddress = await newMailBox.createEmailAddress('customerName');

// get the first mail matching containing the subjectQuery
const message = await newMailBox.getInbox('welcome to mailsac', t)

// get the content of a specific mail. Using the message object from above
// set deleteMail to true to have the mail deleted immediately
// add mode to specify 'dirty' or 'text'. Default: 'dirty'
const mailContent = await newMailBox.getMail(message._id);

ES5

var MailBox = require('prodperfect-mailsac');

// create a temporary email mailbox
var mailbox = new Mailbox();

// generate a new (random) email address. replace customerName with the name of the customer
mailbox.createEmailAddress('customerName')
  .then(function(addr) {
    console.log('email addr: ', + addr);
  });

// get the first mail matching containing the subjectQuery
mailbox.getInbox('welcome to mailsac', t)
  .then(function(foundEmail) {
    console.log('foundEmail :', foundEmail);
  });

// get the content of a specific mail. Using the message object from above
// set deleteMail to true to have the mail deleted immediately
// add mode to specify 'dirty' or 'text'. Default: 'dirty'
mailbox.getMail(message._id);
  .then(function(fullMessage) {
    console.log('full message :', fullMessage);
  });

FAQs

Package last updated on 13 Jun 2019

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.