mailigen
A JS library for using the Mailigen API
Last updated 2 years ago by hstove .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install mailigen 
SYNC missed versions from official npm registry.

Mailigen JS

This simple library gives you the ability to add email to your newsletter lists on Mailigen.

Installation

yarn add mailigen

Environment Variables

To use this library, you need to set 2 API keys as environment variables.

  • MAILIGEN_LIST
    • Set this to your List ID. See below for finding your list ID.
  • MAILIGEN_API_KEY
    • Your API key

Finding your List ID

To find your List ID:

  1. View all of your lists
  2. Select the list you want to use
  3. On the list page, click "List Actions" -> "Web Signup Forms"
  4. Web Signup forms
  5. Click the link next to "Your hosted web signup form link"
  6. Copy the id URL parameter on the link that opens. This is your List ID for use with the API

Using Mailigen JS

The subscribe method uses 3 arguments:

  1. The email to add
  2. Any merge variable you want to use (defaults to {})
  3. Any extra options to pass to the listSubscribe method (defaults to {})

Here is an example:

import { subscribe } from 'mailigen';

async function addEmail(email, firstName) {
  const response = await subscribe(email, { 'FNAME': firstName }, { 
    send_welcome: true
  });
}

Current Tags

  • 1.0.2                                ...           latest (2 years ago)

3 Versions

  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 1
Dependencies (2)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2016 © taobao.org |