GithubHelp home page GithubHelp logo

mail7-node-sdk's Introduction

About Mail7

​Mail7.io is a service that allows receiving emails at a temporary address that self-destructed after 24 hours. It is the most advanced throwaway email service that helps you avoid spam and stay safe in such cases.

Installation

npm i --save mail7

Configuration

Replace the placeholders in the config object with your mail7 credentials apikey and apisceret. These can be obtained from here

var  config = {
     apiKey:  '<mail7 apikey>',
     apiSecret:  '<mail7 apisecret>'
}

Don't have Mail7 Account ? Create you own account here and get your apikey and apisecret

Require the mail7 package and pass the config object

var mail7 = require('mail7')(config);

Usage

mail7.getInboxByEmail("<[email protected]>").then((response) => {
   console.log(response);
}).catch((error) => {
   console.log(error);
});

The detailed document for apis parameters, body and output format, you can go through the mail7 documents

Inbox APIs:

Params

  • @param {string} to - full email address or username for example testme or [email protected]
  • @param {string} mesgid - the id of particular email object
  • @param {string} domain - the domain name email is created by

As mail7 support custom domain, so you can use any email like [email protected]. But you no need to pass this domain explicitly in function param as domain will be fetched from email. But make sure that your mail7 plan included the custom domain email addresses

Routing Rules APIs:

Params

  • @param {object} data - json object for rules need to be create
  • @param {string} ruleName - rule to be delete

If only username testme is passed then it will be treated as default mail7.io domain email like [email protected]

It is suggested that pass full email address for any other domain like [email protected]

JSONP Requests ('callback'):

If you need to receive your API response wrapped inside a JSONP callback function, you can use the callback query parameter with any valid API route. The data will be returned wrapped in the callback function you specify.

The callback value can be any valid JavaScript method name.

The entire JSON API response will be delivered wrapped in the requested callback function.

Example JSONP Query
mail7.getInboxByEmail("<[email protected]>", "myCallbackFunction" ).then((response) => {
   console.log(response);
}).catch((error) => {
   console.log(error);
});
JSONP Response
myCallbackFunction({ status: 'success',
  data:
   [{ _id: '5f8ffebc0552080017029286',
       to_username: 'testmail7',
       to_domain: 'mail7.io',
       mail_source: [Object],
       is_deleted: false,
       is_read: false,
       sender_time: '2020-10-21T09:26:20.533Z' }] 
   })

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.