0.0.1 • Published 5 years ago

mailchimp-releasemail v0.0.1

Weekly downloads
62
License
MIT
Repository
-
Last release
5 years ago

mailchimp-releasemail

Send automated release mails with Conventional Changelog via MailChimp.

Prerequisites

CLI

If you want to use the CLI, you can install this package globally:

$ npm install mailchimp-releasemail -g

This will install the release-mail binary.

When using the CLI, it will automatically look for an .releasemailrc file in the current working directory. Your can change this by using the --config flag.

.releasemailrc

The .releasemailrc file is a JavaScript file which will be required by the releasemail script. Below an example:

var pkg = require('./package.json');

module.exports = {
  apiKey:      process.env.MC_API_KEY,
  subject:     'Software release v' + pkg.version + ' 🚀',
  previewText: 'See all new features and bug fixes',
  listId:      '<mailchimp list id>',
  fromName:    'Your name',
  replyTo:     'your@email.com',
  templateId:  11223344,
  sections:    {
    version: 'v' + pkg.version,
  },
};

Node

It is also possible to send release mails from your node script.

$ npm install mailchimp-releasemail

Now you can use it like so:

var releasemail = require('mailchimp-releasemail');
var pkg = require('./package.json');

releasemail({
  apiKey:      process.env.MC_API_KEY,
  subject:     'Software release v' + pkg.version + ' 🚀',
  previewText: 'See all new features and bug fixes',
  listId:      '<mailchimp list id>',
  fromName:    'Your name',
  replyTo:     'your@email.com',
  templateId:  11223344,
  sections:    {
    version: 'v' + pkg.version,
  },
}).then(function() {
  // success :-D
}).catch(function() {
  // error :-(
});