npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

seeuletter

v1.5.2

Published

Seeuletter API wrapper

Downloads

1,671

Readme

seeuletter-node

NPM version Dependency Status

Seeuletter.com Node.js Client is a simple but flexible wrapper for the Seeuletter.com API.

See full Seeuletter.com documentation here.

For best results, be sure that you're using the latest version of the Seeuletter API and the latest version of the Node.js wrapper.

French

Un module NPM pour envoyer du courrier postal ou electronique en ligne depuis votre application Node.Js.

Seeuletter propose une API permettant d'envoyer très facilement du courrier postal ou électronique depuis votre ERP, CRM ou application web.

Pas de frais d'installation. Pas d'engagement. Vous payez ce que vous consommez.

Documentation : https://docs.seeuletter.com/

Bien démarrer : https://www.seeuletter.com/guide/bien-demarrer-avec-l-api-d-envoi-de-courrier

Table of Contents

Getting Started

Here's a general overview of the Seeuletter services available, click through to read more.

Please read through the official API Documentation to get a complete sense of what to expect from each endpoint.

Registration

First, you will need to first create an account at Seeuletter.com and obtain your Test and Live API Keys.

Once you have created an account, you can access your API Keys from the Settings Panel.

Installation

seeuletter-node can be installed through the npm:

$ npm install -S seeuletter

To build and install from the latest source:

$ git clone [email protected]:Seeuletter/seeuletter-node.git
$ npm install

Letters

Create a new letter - Callback style

var Seeuletter = require('seeuletter')('YOUR API KEY');

// callback pattern
Seeuletter.letters.create({
  description: 'Test Letter from the Node.js Wrapper',
  to: {
    name: 'Erlich',
    address_line1: '30 rue de rivoli',
    address_line2: '',
    address_city: 'Paris',
    address_country: 'France',
    address_postalcode: '75004'
  },
  postage_type: 'prioritaire',
  color: 'bw',
  source_file: '<html>Hello, {{nom}}</html>',
  source_file_type: 'html',
  variables: {
    nom : 'Seeuletter'
  }
}, function (err, body) {
   if (err) console.log('err : ' , err.message);
   console.log('body : ', body)
})

Create a new letter - Promise style

var Seeuletter = require('seeuletter')('YOUR API KEY');

// promise pattern
Seeuletter.letters.create({
  description: 'Test Letter from the Node.js Wrapper',
  to: {
    name: 'Erlich',
    address_line1: '30 rue de rivoli',
    address_line2: '',
    address_city: 'Paris',
    address_country: 'France',
    address_postalcode: '75004'
  },
  postage_type: 'prioritaire',
  color: 'bw',
  source_file: '<html>Hello, {{nom}}</html>',
  source_file_type: 'html',
  variables: {
    nom : 'Seeuletter'
  }
})
.then(function (response) {
  console.log('response : ', response);
})
.catch(function (err) {
  console.log('err : ', err);
});

Create a new electronic letter - Promise style

var Seeuletter = require('seeuletter')('YOUR API KEY');

// promise pattern
Seeuletter.letters.createElectronic({
  description: 'Test electronic letter from the Node.js Wrapper',
  to: {
    email: '[email protected]',
    first_name: 'Erlich',
    last_name: 'Dumas',
    status: 'individual'
  },
  postage_type: 'lre',
  content: 'Please review the attached documents:',
  source_file: '<html>Hello, {{nom}}</html>',
  source_file_type: 'html',
  variables: {
    nom : 'Seeuletter'
  }
})
.then(function (response) {
  console.log('response : ', response);
})
.catch(function (err) {
  console.log('err : ', err);
});

List all Letters

var Seeuletter = require('seeuletter')('test_12345678901234567890')

Seeuletter.letters.list()
.then(function (response) {
  console.log('response : ', response);
})
.catch(function (err) {
  console.log('err : ', err);
});

Retrieve a specific Letter

var Seeuletter = require('seeuletter')('test_12345678901234567890')

Seeuletter.letters.retrieve('LETTER_ID')
.then(function (response) {
  console.log('response : ', response);
})
.catch(function (err) {
  console.log('err : ', err);
});

Postcards

Create a new postcard - Promise style

var Seeuletter = require('seeuletter')('YOUR API KEY');

// Create the address
Seeuletter.postcards.create({
  description: 'Test Postcard from the Node.js Wrapper',
  to: {
    name: 'Erlich',
    address_line1: '30 rue de rivoli',
    address_line2: '',
    address_city: 'Paris',
    address_country: 'France',
    address_postalcode: '75004'
  },
  // https://www.seeuletter.com/templates
  source_file_front: 'YOUR TEMPLATE ID',
  source_file_front_type: 'template_id',
  source_file_back: 'YOUR TEMPLATE ID',
  source_file_back_type: 'template_id',

  variables: {
    PRENOM: 'Erlich',
    NOM: 'Bachman',
    CODE_PROMO_BIENVENUE: 'CODE',
    URL_COURTE_BIENVENUE: 'https://goo.gl/uqTHnD',
    ADRESSE: '30 rue de Rivoli',
    CODE_POSTAL : '75004',
    VILLE : 'Paris',
    PAYS : 'France'
  }
})
  .then(function (letter) {
    console.log('The Seeuletter API Postcard responded : ', letter)
  })
  .catch(function (err) {
    console.log('Error message : ', err.message)
  })

Accounts

Create a new account for the company

var Seeuletter = require('seeuletter')('YOUR API KEY');

// Create the account
Seeuletter.accounts.create({
  email: "[email protected]",
  name: "Erlich Bachman",
  phone: "+33104050607",
  company_name: "MSB Partner",
  address_line1: '30 rue de rivoli',
  address_line2: '',
  address_city: 'Paris',
  address_country: 'France',
  address_postalcode: '75004'
})
  .then(function (account) {
    console.log('The Seeuletter API Account responded : ', account)
  })
  .catch(function (err) {
    console.log('Error message : ', err.message)
  })

Update the account company email

var Seeuletter = require('seeuletter')('YOUR API KEY');

// Update the account
Seeuletter.accounts.updateEmail("ACCOUNT COMPANY ID", "UPDATED EMAIL")
  .then(function () {
    console.log('The Seeuletter API Account responded with success')
  })
  .catch(function (err) {
    console.log('Error message : ', err.message)
  })

Invoices

List all invoices for a company

var Seeuletter = require('seeuletter')('YOUR API KEY');

// Getting the invoice list
Seeuletter.invoices.list({
  // Pass optional filter here as object
})
  .then(function (response) {
    console.log('The Seeuletter API Invoices responded : ', response)
  })
  .catch(function (err) {
    console.log('Error message : ', err.message)
  })

Retrieve a specific invoice

var Seeuletter = require('seeuletter')('YOUR API KEY');

// Getting the invoice list
Seeuletter.invoices.retrieve("INVOICE ID")
  .then(function (invoice) {
    console.log('The Seeuletter API Invoice responded : ', invoice)
  })
  .catch(function (err) {
    console.log('Error message : ', err.message)
  })

Examples

We've provided various examples for you to try out here.

=======================

Copyright © 2017 Seeuletter.com

Released under the MIT License, which can be found in the repository in LICENSE.txt.