Skip to content
This repository has been archived by the owner on Feb 18, 2023. It is now read-only.

alex-zissis/createsend-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CreateSend JS

A modern wrapper for the CreateSend API in Node.JS.

NB: This is still in early alpha and not recommended for use

Installation

yarn add createsend-js

OR

npm i createsend-js

Usage

Initialisation

import {CreateSend} from 'createsend-js'; // or const {CreateSend} = require('createsend-js')

const cs = new CreateSend(<apiKey>);

Account

cs.account.getClients().then((clients) => console.log(clients)); // [ {Name: "Example", ClientID: 'a1a1a1a1a1a1a1' } ]

Clients

cs.clients.getSubscriberLists(<clientId>).then(); // [ {Name: "Example List", ListId: 'a1a1a1a1a1a1a1' } ]

Transactional

cs.transactional.getSmartEmailListing({clientId: <clientId>}).then(emails => console.log(emails)) // [{ ID: 'a1a1a1a1a1a1a1', Name: 'txemail', CreatedAt: '2020-02-05T02:02:02', Status: 'Active' }]

cs.transactional.sendSmartEmail(<smartEmailId>, {
    To: ['alex@alexzissis.tech'],
    CC: ['alex+cc@alexzissis.tech'],
    BCC: ['alex+bcc@alexzissis.tech'],
    ConsentToTrack: 'Yes',
    Data: {
        firstName: 'Alex',
    }
}).then(response => console.log(response)); //{ Status: 'Accepted', MessageId: 'a1a1a1', Recipient: 'alex@alexzissis.tech'}

About

A modern wrapper for the CreateSend API in Node.JS

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published