https://github.com/homezen/campaignmonitor-node
universal javascript wrapper for campaign monitor api
https://github.com/homezen/campaignmonitor-node
campaign-monitor campaignmonitor createsend email-marketing universal-javascript
Last synced: 6 months ago
JSON representation
universal javascript wrapper for campaign monitor api
- Host: GitHub
- URL: https://github.com/homezen/campaignmonitor-node
- Owner: homezen
- License: bsd-3-clause
- Created: 2017-03-01T18:23:41.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-01T07:00:38.000Z (almost 7 years ago)
- Last Synced: 2024-10-09T09:50:24.260Z (8 months ago)
- Topics: campaign-monitor, campaignmonitor, createsend, email-marketing, universal-javascript
- Language: JavaScript
- Homepage:
- Size: 73.2 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Campaign Monitor API wrapper
[](https://circleci.com/gh/homezen/campaignmonitor-node)
[](https://codecov.io/gh/homezen/campaignmonitor-node)
[](https://greenkeeper.io/)Universal javascript wrapper for campaign monitor api
## Supported platforms
Compatible with node, webpack, and browserify
## Getting Started
```bash
$ npm i --save campaignmonitor
``````js
import campaignMonitor from 'campaignmonitor'
```You must initialize the object with options before using.
```js
import campaignMonitor from 'campaignmonitor'const api = campaignMonitor(options)
```## Options
#### apiKey
API key used for campaign monitor authentication - [campaign monitor
docs](docshttps://www.campaignmonitor.com/api/getting-started/#authenticating-api-key)## API
### Subscribers
Uses [Campaign Monitor subscribers API](https://www.campaignmonitor.com/api/subscribers/)
#### `addSubscriber`
Adds subscriber to specified list
Params
- {string} - list ID - API Subscriber List ID from Campaign Monitor
- {object} - request body - should map to fields in [subscriber api docs](https://www.campaignmonitor.com/api/subscribers/#adding-a-subscriber)
Returns
- Email address of user that was subscribed (see [CM
docs](https://www.campaignmonitor.com/api/subscribers/#adding-a-subscriber) for more)## Development
### Running tests
To run the full suite, run
```bash
npm test
```### Other commands
#### `npm start`
Runs build, test, and lint watchers
#### `npm run tdd`
Run test watcher
#### `npm run lint`
Run linter
#### `npm run build`
Builds the production assets suitable for release
#### `npm run release`
Builds, git tags release, and publishes to npm
## CI/CD
### Releases
Every commit to master defaults to a patch bump. If it needs to be a minor or major, ENSURE YOU DO
THE FOLLOWING:If you would like to create a release, add the following to the merge commit message when you merge
a PR:```bash
release v+
```Where `` is one of:
* major
* minor
* patch (default)This will:
1. Bump version in package.json and commit back to master
1. Git tag that newly created commit with the new version
1. Publish to npm