📮 Email queue extending NodeMailer with multi SMTP transports and horizontally scaled applications support
📦 NPM @3.0.0
☄️ Packosphere @3.0.0
Major Changes
v2.x
in order to match Meteor's version (NPM release happened one generation later)import
and require
the package import { MailTime, MongoQueue, RedisQueue } from 'mail-time';
{queue}
passed to constructor new MailTime({})
callback
from .sendMail()
methodjosk
task manager and Queue driver can use different databasesWhats' new
ping()
methodcancelMail()
methodonSent()
callback optionopts.josk
option for josk
library-specific optionsopts.queue
option for storage-driveropts.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
Changes
.sendMail()
now returns {Promise<string>}
that can get passed into .cancelMail()
methodDependencies
[email protected]
, was v3.1.1
[email protected]
, was v4.2.2
Dev Dependencies
[email protected]
, was v4.4.1
[email protected]
, was v10.3.0
[email protected]
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);
📦 NPM @1.4.0
☄️ Packosphere @2.5.0
Major Changes:
@>=14.20.0
, was @>=8.9.0
Changes:
.sendMail
callbacks on single-server setup when {concatEmails: true}
option enabled.sendMail
callbacks when {keepHistory: true}
option enabledmongod
server, tested with @4.4.29
, @5.0.25
, @6.0.14
, and @7.0.6
mongodb
driver for node.js, tested with @4.17.2
, @5.9.2
, and @6.5.0
nodejs
releases, tested with @14.21.3
, @18.19.1
, @20.11.1
, and @21.7.1
[email protected]
and its packagesDependencies:
[email protected]
, was v3.0.2
[email protected]
, was v4.2.2
Dev Dependencies:
[email protected]
, was v4.7.0
[email protected]
, was v4.3.6
[email protected]
, was v10.0.0
[email protected]
, was v4.17.2
[email protected]
, was v6.7.8
[email protected]
, was v3.0.7
Major Changes:
📦 NPM: @1.3.4
☄️ Atmosphere @2.4.4
Changes:
Notes:
nodemailer
Dependencies:
[dev]
[email protected]
, was v4.6.4
[dev]
[email protected]
, was v4.0.2
[dev]
[email protected]
, was v4.7.0
[dev]
[email protected]
, was v6.7.8
📦 NPM: @1.3.3
☄️ Atmosphere @2.4.3
Dependencies:
[email protected]
, was v3.0.1
[dev]
[email protected]
, was v6.7.5
📦 NPM: @1.3.2
☄️ Atmosphere @2.4.2
Changes:
[email protected]
Dependencies:
[email protected]
, was v3.0.0
[dev]
[email protected]
, was v4.6.0
📦 NPM: @1.3.0
☄️ Atmosphere @2.4.0
Changes:
Other changes:
[email protected]
(Mongo Database)[email protected]
(Mongo Database)[email protected]
(Mongo Database)[email protected]
(MongoDB node.js driver)[email protected]
Dependencies:
[email protected]
, was v2.4.0
Development dependencies:
Used by test suite
[email protected]
, was v4.2.2
[email protected]
, was v2.0.5
[email protected]
, was v4.3.0
[email protected]
, was v8.2.1
[email protected]
, was v3.6.4
[email protected]
, was v6.4.17
[email protected]
, was v3.3.2
(tested with both versions, sticking to 3.0.7
to avoid security warnings)This is maintenance update
Notable Changes:
{ writeConcern }
options removed from write/update operations, pass readConcern
, writeConcern
, and readPreference
as mongodb connections settings.Changes:
Cursor#close()
;[email protected]
(the driver);[email protected]
;josk
upgaded to v2.4.0
;v2.3.5
;v1.2.5
;[email protected]
;[email protected]
;keepHistory
option;[email protected]
, was v2.2.5
;[dev]
[email protected]
, was v4.0.4
;[dev]
[email protected]
, was v2.0.3
;[dev]
[email protected]
, was v7.1.2
;[dev]
[email protected]
, was v3.5.7
;[dev]
[email protected]
, was v6.4.6
.v2.3.4
;v1.2.4
;Changes:
___compileMailOpts()
method without configured transports.[email protected]
;[email protected]
;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
;