mail-time 1.3.2 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -25
- package/index.js +3 -3
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -6,19 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
# MailTime
|
|
8
8
|
|
|
9
|
-
Micro-service package for mail queue, with *Server* and *Client* API.
|
|
10
|
-
Build on top of [`nodemailer`](https://github.com/nodemailer/nodemailer) package.
|
|
11
|
-
|
|
12
|
-
Every `MailTime` instance can be configured to be a *Server* or *Client*.
|
|
13
|
-
|
|
14
|
-
Main difference of *Server* from *Client* - *Server* handles queue and actually sends email.
|
|
15
|
-
While *Client* is only put emails into the queue.
|
|
16
|
-
|
|
17
9
|
"Mail-Time" is a micro-service package for mail queue, with *Server* and *Client* APIs. Build on top of the [`nodemailer`](https://github.com/nodemailer/nodemailer) package.
|
|
18
10
|
|
|
19
|
-
Every `MailTime` instance can get configured as *Server* or *Client*.
|
|
11
|
+
Every `MailTime` instance can get `type` configured as *Server* or *Client*.
|
|
20
12
|
|
|
21
|
-
The main difference between *Server* and *Client*
|
|
13
|
+
The main difference between *Server* and *Client* `type` is that the *Server* handles the queue and __sends__ email. While the *Client* only __adds__ emails into the queue.
|
|
22
14
|
|
|
23
15
|
## ToC
|
|
24
16
|
|
|
@@ -432,21 +424,6 @@ DEBUG="true" EMAIL_DOMAIN="example.com" MONGO_URL="mongodb://127.0.0.1:27017/npm
|
|
|
432
424
|
# Be patient, tests are taking around 2 mins
|
|
433
425
|
```
|
|
434
426
|
|
|
435
|
-
Test Atmosphere (meteor.js) package:
|
|
436
|
-
|
|
437
|
-
```shell
|
|
438
|
-
# Default
|
|
439
|
-
EMAIL_DOMAIN="example.com" meteor test-packages ./ --driver-package=meteortesting:mocha
|
|
440
|
-
|
|
441
|
-
# With custom port
|
|
442
|
-
DEBUG="true" EMAIL_DOMAIN="example.com" meteor test-packages ./ --driver-package=meteortesting:mocha --port 8888
|
|
443
|
-
|
|
444
|
-
# With local MongoDB and custom port
|
|
445
|
-
DEBUG="true" EMAIL_DOMAIN="example.com" MONGO_URL="mongodb://127.0.0.1:27017/meteor-mail-time-test-001" meteor test-packages ./ --driver-package=meteortesting:mocha --port 8888
|
|
446
|
-
|
|
447
|
-
# Be patient, tests are taking around 2 mins
|
|
448
|
-
```
|
|
449
|
-
|
|
450
427
|
## Support this project:
|
|
451
428
|
|
|
452
429
|
- Star on [GitHub](https://github.com/veliovgroup/mail-time)
|
package/index.js
CHANGED
|
@@ -162,13 +162,13 @@ module.exports = class MailTime {
|
|
|
162
162
|
throw new Error('[mail-time] transports is required and must be an Array, like returned from `nodemailer.createTransport`');
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
this.collection = opts.db.collection(
|
|
166
|
-
this.collection.createIndex({
|
|
165
|
+
this.collection = opts.db.collection(`__mailTimeQueue__${this.prefix}`);
|
|
166
|
+
this.collection.createIndex({ isSent: 1, to: 1, sendAt: 1 }, (indexError) => {
|
|
167
167
|
if (indexError) {
|
|
168
168
|
_logError('[createIndex]', indexError);
|
|
169
169
|
}
|
|
170
170
|
});
|
|
171
|
-
this.collection.createIndex({
|
|
171
|
+
this.collection.createIndex({ isSent: 1, sendAt: 1, tries: 1 }, { background: true }, (indexError) => {
|
|
172
172
|
if (indexError) {
|
|
173
173
|
_logError('[createIndex]', indexError);
|
|
174
174
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mail-time",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.4",
|
|
4
4
|
"description": "Bulletproof email queue on top of NodeMailer for a single and multi-server setups",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -49,15 +49,15 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"deepmerge": "^4.2.2",
|
|
52
|
-
"josk": "^3.0.
|
|
52
|
+
"josk": "^3.0.2"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"bson": "^4.
|
|
56
|
-
"bson-ext": "^4.0.
|
|
55
|
+
"bson": "^4.7.0",
|
|
56
|
+
"bson-ext": "^4.0.3",
|
|
57
57
|
"chai": "^4.3.6",
|
|
58
58
|
"mocha": "^10.0.0",
|
|
59
|
-
"mongodb": "^4.
|
|
60
|
-
"nodemailer": "^6.7.
|
|
59
|
+
"mongodb": "^4.10.0",
|
|
60
|
+
"nodemailer": "^6.7.8",
|
|
61
61
|
"nodemailer-direct-transport": "^3.0.7"
|
|
62
62
|
}
|
|
63
63
|
}
|