0.1.1 • Published 3 years ago

mailclerk v0.1.1

Weekly downloads
9
License
ISC
Repository
github
Last release
3 years ago

Mailclerk Node

Mailclerk helps anyone on your team design great emails, improve their performance, and free up developer time. Learn more

Table of Contents

Setup

To install, run:

npm install mailclerk

API Key & URL

To set the Mailclerk API Key (begins with mc_), you can provide it as an environmental variable: MAILCLERK_API_KEY. Alternatively, you provide it while initializing the client:

const mailclerk = require("mailclerk")("mc_yourprivatekey")

If you are using version control like git, we strongly recommend storing your production API keys in environmental variables.

The default API endpoint is https://api.mailclerk.app. To change this, you can provide a MAILCLERK_API_URL ENV variable.

Usage

You'll need an active account and at least one template (in the example welcome-email).

To send an email to "eve@example.com":

const mailclerk = require("mailclerk")();
mailclerk.deliver("welcome-email", "eve@example.com")

If the template has any dynamic data, you can include it in the third parameter as a hash:

mailclerk.deliver("welcome-email", "eve@example.com", { "name": "Eve" })

deliver returns a promise:

mailclerk.deliver("welcome-email", "eve@example.com").then(data => {
  console.log("Success!", data)
}).catch(error => {
  console.error(error);
})

See Mailclerk documentation for more details.

Tests

Tests aren't currently implemented.

Versioning

Read Semantic Versioning for details. Briefly, it means:

  • Major (X.y.z) - Incremented for any backwards incompatible public API changes.
  • Minor (x.Y.z) - Incremented for new, backwards compatible, public API enhancements/fixes.
  • Patch (x.y.Z) - Incremented for small, backwards compatible, bug fixes.

Code of Conduct

Please note that this project is released with a CODE OF CONDUCT. By participating in this project you agree to abide by its terms.

Contributions

Read CONTRIBUTING for details.

License

Copyright 2021 Mailclerk. Read LICENSE for details.

History

Read CHANGES for details. Built with Gemsmith.

0.1.1

3 years ago

0.1.0

3 years ago