Mail Time Versions Save

📮 Email queue extending NodeMailer with multi SMTP transports and horizontally scaled applications support

3.0.0

1 month ago

📦 NPM @3.0.0 ☄️ Packosphere @3.0.0

Major Changes

  • ☝️ NPM release skipped v2.x in order to match Meteor's version (NPM release happened one generation later)
  • ⚠️ New way to import and require the package import { MailTime, MongoQueue, RedisQueue } from 'mail-time';
  • ⚠️ Decouple from storage, now requires {queue} passed to constructor new MailTime({})
  • ⚠️ Removed callback from .sendMail() method
  • 🟥 Added support for Redis as Queue storage driver 🥳
  • 🍃 MongoDB as optional Queue storage driver 🥳
  • ☝️ Now josk task manager and Queue driver can use different databases

Whats' new

  • ping() method
  • cancelMail() method
  • onSent() callback option
  • ✨ new opts.josk option for josk library-specific options
  • ✨ new opts.queue option for storage-driver
  • opts.retryDelay retry delay in ms, successor to opts.interval
  • opts.retries quantity of retry attempts, successor to opts.maxTries
  • opts.concatDelay concatenation delay in ms, successor to opts.concatThrottling
  • 👨‍🔬 A lot of new improved tests
  • 📔 Custom Queue API

Changes

  • ☝️ .sendMail() now returns {Promise<string>} that can get passed into .cancelMail() method

Dependencies

Dev Dependencies

Migrate to v3

Import was in v1/v2:

import MailTime from 'mail-time';

Changed in v3 to:

import { MailTime, MongoQueue, RedisQueue } from 'mail-time';

new MailTime in v3

Constructor was in v1/v2:

new MailTime({
  db,
})

Changed in v3 to:

new MailTime({
  queue: new MongoQueue({ db }),
  josk: {
    adapter: {
      type: 'mongo',
      db: db
    }
  }
})

prefix in v3

Constructor was in v1/v2:

new MailTime({
  db,
  prefix: 'prefix'
})

prefix need to get duplicated in queue constructor in v3:

new MailTime({
  prefix: 'prefix',
  queue: new MongoQueue({
    db: db,
    prefix: 'prefix',
  }),
  josk: {
    adapter: {
      type: 'mongo',
      db: db,
    }
  }
})

sent/failed callback in v3

Constructor was in v1/v2:

MailTime#sendMail(message, (error, details) => {
  console.log({error, details})
});

Callbacks are removed in v3, onError and onSent should be used instead:

const mailQueue = new MailTime({
  queue: new MongoQueue({ db }),
  josk: {
    adapter: { type: 'mongo', db }
  },
  onError(error, email, details) {
    console.log(`Email "${email.mailOptions.subject}" wasn't sent to ${email.mailOptions.to}`, error, details);
  },
  onSent(email, details) {
    console.log(`Email "${email.mailOptions.subject}" successfully sent to ${email.mailOptions.to}`, details);
  },
});

await mailQueue.sendMail(message);

1.4.0

1 month ago

📦 NPM @1.4.0 ☄️ Packosphere @2.5.0

Major Changes:

  • ⚠️ Minimal required version of Node.js now is @>=14.20.0, was @>=8.9.0
  • 📦 Packaged as ES Module (reverse-compatible with CommonJS)

Changes:

  • 👨‍🔧 Fix minor bug when re-send loop was trying non-existent transport if only single transport defined
  • 👨‍🔧 Fix .sendMail callbacks on single-server setup when {concatEmails: true} option enabled
  • 👨‍🔧 Fix .sendMail callbacks when {keepHistory: true} option enabled
  • 📔 Refined documentation
  • 🤝 Compatibility with mongod server, tested with @4.4.29, @5.0.25, @6.0.14, and @7.0.6
  • 🤝 Compatibility with mongodb driver for node.js, tested with @4.17.2, @5.9.2, and @6.5.0
  • 🤝 Compatibility with the latest nodejs releases, tested with @14.21.3, @18.19.1, @20.11.1, and @21.7.1
  • 🤝 Compatibility with the latest Meteor.js and its packages
  • 🤝 Compatibility with upcoming [email protected] and its packages

Dependencies:

Dev Dependencies:

1.3.4_

1 year ago

Major Changes:

📦 NPM: @1.3.4 ☄️ Atmosphere @2.4.4

Changes:

  • 👷‍ Merged: #35 - Improve indexes by @PeteMac88

Notes:

  • 👨‍🔬 Tested with latest mongodb server 5.0.11 and 6.0.1
  • 👨‍🔬 Tested with latest nodemailer

Dependencies:

1.3.3_

1 year ago

📦 NPM: @1.3.3 ☄️ Atmosphere @2.4.3

Dependencies:

1.3.2

1 year ago

📦 NPM: @1.3.2 ☄️ Atmosphere @2.4.2

Changes:

Dependencies:

1.3.1

1 year ago

📦 NPM: @1.3.1 ☄️ Atmosphere @2.4.1

Changes:

  • 👨‍🔧 Fix emails removed with {keepHistory : true}

Other changes:

  • 👨‍💻 Minor codebase refactoring
  • 📔 Documentation update
  • 👨‍🔬 Improve tests

1.3.0

2 years ago

📦 NPM: @1.3.0 ☄️ Atmosphere @2.4.0

Changes:

  • 🔧 Fix #31 by @bacloud22 (thank you!)
  • 👨‍🔧 Merge #24, improving "concatenated" emails queue management, thanks to @Treenity
  • 👨‍💻 Reduced mongoDB calls
  • 👨‍💻 Overall package codebase refactoring
  • 👨‍🔬 Improve tests suite

Other changes:

Dependencies:

Development dependencies:

Used by test suite

1.2.6

3 years ago
  • ☄️ NPM: v1.2.6
  • 📦 Meteor: v2.3.6

This is maintenance update

Notable Changes:

  • Default { writeConcern } options removed from write/update operations, pass readConcern, writeConcern, and readPreference as mongodb connections settings.

Changes:

  • 👷 Fix possible memory leak with forcefully closing cursors Cursor#close();
  • 🤝 Compatibility with [email protected] (the driver);
  • 🤝 Compatibility with [email protected];
  • 📦 josk upgaded to v2.4.0;

1.2.5

3 years ago
  • ☄️ Meteor: v2.3.5;
  • 📦 NPM: v1.2.5;

Changes

New

  • keepHistory option;

📦 Dependencies:

1.2.4

4 years ago
  • ☄️ Meteor: v2.3.4;
  • 📦 NPM: v1.2.4;

Changes:

  • 🐞 Edge case bug fix: Minor fix to trow an error (instead of silent interruption) when context is lost or misconfiguration is in place. Upon calling internal ___compileMailOpts() method without configured transports.
  • 👷‍♂️ This is regular maintenance release;
  • 🤝 Compatibility with [email protected];
  • 🤝 Compatibility with [email protected];
  • 📦 Update josk package to v2.2.5, was: v2.2.3;
  • 📦 [dev-dependency] Update bson package to v4.0.4, was v4.0.3;
  • 📦 [dev-dependency] Update mocha package to v7.1.0, was v7.1.2;
  • 📦 [dev-dependency] Update mongodb package to v3.5.7, was v3.5.4;
  • 📦 [dev-dependency] Update nodemailer package to v6.4.6, was v6.4.4;
  • 📋 Minor documentation updates.