Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nodemailer-sequelize-queue

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodemailer-sequelize-queue - npm Package Compare versions

Comparing version 0.0.10 to 0.0.13

1

dist/index.d.ts

@@ -34,2 +34,3 @@ import { AddQueueModelAttributes, IQueueModel } from './QueueModel';

expression?: string;
logging?: boolean;
};

4

dist/index.js

@@ -28,3 +28,3 @@ "use strict";

}
new Scheduler_1.default(this.smtpCredentials, this.queueModel, this.options.expression, this.options.maxAttempts);
new Scheduler_1.default(this.smtpCredentials, this.queueModel, this.options.expression, this.options.maxAttempts, this.options.logging);
}

@@ -52,2 +52,2 @@ async initModels() {

exports.default = NodemailerSequelizeQueue;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSw4REFBa0c7QUFDbEcseUNBQXFEO0FBQ3JELDREQUFtQztBQUVuQyxNQUFxQix3QkFBd0I7SUFPM0MsWUFBWSxnQkFBa0MsRUFBRSxlQUFvQixFQUFFLE9BQWlCO1FBQ3JGLElBQUksQ0FBQyxZQUFZLENBQUMsZ0JBQWdCLENBQUMsQ0FBQTtRQUNuQyxJQUFJLENBQUMsZUFBZSxHQUFHLGVBQWUsQ0FBQTtRQUN0QyxJQUFJLENBQUMsT0FBTyxHQUFHLE9BQU8sQ0FBQTtJQUN4QixDQUFDO0lBRU8sS0FBSyxDQUFDLFlBQVksQ0FBQyxnQkFBa0M7UUFDM0QsSUFBSSxDQUFDLFNBQVMsR0FBRyxnQkFBZ0IsQ0FBQyxTQUFTO1lBQ3pDLENBQUMsQ0FBQyxnQkFBZ0IsQ0FB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5jcmVhdGUoZGF0YSwge1xuICAgICAgcmV0dXJuaW5nOiB0cnVlLFxuICAgIH0pXG4gICAgaWYgKCFxdWV1ZUVudGl0eS5nZXQoJ2lkJykpIHtcbiAgICAgIHRocm93IG5ldyBFcnJvcignRXJyb3IgcXVldWVpbmcgZW1haWwnKVxuICAgIH1cbiAgICByZXR1cm4gcXVldWVFbnRpdHlcbiAgfVxufVxuXG5leHBvcnQgaW50ZXJmYWNlIElOb2RlbWFpbGVyU2VxdWVsaXplUXVldWUge1xuICBxdWV1ZU1haWwoZGF0YTogQWRkUXVldWVNb2RlbEF0dHJpYnV0ZXMpOiBQcm9taXNlPE1vZGVsPGFueSwgYW55Pj5cbiAgaW5pdFNjaGVkdWxlcigpOiBQcm9taXNlPHZvaWQ+XG59XG5cbmV4cG9ydCB0eXBlIERiQ29uZmlnID0ge1xuICB1c2VybmFtZTogc3RyaW5nXG4gIHBhc3N3b3JkOiBzdHJpbmdcbiAgZGF0YWJhc2U6IHN0cmluZ1xuICBob3N0OiBzdHJpbmdcbiAgZGlhbGVjdDogRGlhbGVjdFxuICBsb2dnaW5nPzogYm9vbGVhbiB8ICgoc3FsOiBzdHJpbmcsIHRpbWluZz86IG51bWJlcikgPT4gdm9pZClcbn1cblxuZXhwb3J0IHR5cGUgRGJDb25naWZJbnN0YW5jZSA9IHtcbiAgY29uZmlnPzogRGJDb25maWdcbiAgc2VxdWVsaXplPzogU2VxdWVsaXplXG59XG5cbmV4cG9ydCB0eXBlIE9wdGlvbnMgPSB7XG4gIG1heEF0dGVtcHRzPzogbnVtYmVyXG4gIGV4cHJlc3Npb24/OiBzdHJpbmdcbiAgbG9nZ2luZz86IGJvb2xlYW5cbn1cbiJdfQ==

@@ -7,4 +7,5 @@ import { IMailer } from './Mailer';

mailer: IMailer;
logging: boolean;
private queueModel;
constructor(smtpCredentials: any, queueModel: IQueueModelStatic, expression?: string, maxAttemps?: number);
constructor(smtpCredentials: any, queueModel: IQueueModelStatic, expression?: string, maxAttemps?: number, logging?: boolean);
private runJobs;

@@ -14,2 +15,3 @@ private processQueueMails;

private composeMailFromModel;
private log;
}

@@ -20,3 +22,4 @@ export interface IScheduler {

mailer: IMailer;
logging: boolean;
}
export default Scheduler;

@@ -11,3 +11,3 @@ "use strict";

class Scheduler {
constructor(smtpCredentials, queueModel, expression = '0 */1 * * *', maxAttemps = -1) {
constructor(smtpCredentials, queueModel, expression = '0 */1 * * *', maxAttemps = -1, logging = false) {
if (!isCronValid(expression)) {

@@ -18,2 +18,3 @@ throw new Error('Cron expression is invalid');

this.maxAttemps = maxAttemps;
this.logging = logging;
this.runJobs();

@@ -24,2 +25,3 @@ this.queueModel = queueModel;

async runJobs() {
this.log(`Initialising cron schedule ${this.expression}`);
node_cron_1.default.schedule(this.expression, async () => {

@@ -47,2 +49,3 @@ try {

const mails = await this.queueModel.findAll(options);
this.log(`Sending queued mail, number: ${mails}`);
for (const mail of mails) {

@@ -79,2 +82,7 @@ this.sendQueuedMail(mail);

}
log(message, level = 'info') {
if (this.logging) {
logger_1.default.log(level, message);
}
}
}

@@ -86,2 +94,2 @@ function isCronValid(freq) {

exports.default = Scheduler;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU2NoZWR1bGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL1NjaGVkdWxlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLDBEQUE0QjtBQUM1Qix5Q0FBOEI7QUFDOUIsc0RBQW1EO0FBRW5ELDREQUFtQztBQUVuQyxNQUFNLFNBQVM7SUFPYixZQUNFLGVBQW9CLEVBQ3BCLFVBQTZCLEVBQzdCLFVBQVUsR0FBRyxhQUFhLEVBQzFCLFVBQVUsR0FBRyxDQUFDLENBQUM7UUFFZixJQUFJLENBQUMsV0FBVyxDQUFDLFVBQVUsQ0FBQyxFQUFFO1lBQzVCLE1BQU0sSUFBSSxLQUFLLENBQUM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YWlsLnN1YmplY3QsXG4gICAgICBodG1sOiBtYWlsLmh0bWwsXG4gICAgfVxuICAgIHJldHVybiBtZXNzYWdlXG4gIH1cbn1cblxuZXhwb3J0IGludGVyZmFjZSBJU2NoZWR1bGVyIHtcbiAgZXhwcmVzc2lvbjogc3RyaW5nXG4gIG1heEF0dGVtcHM6IG51bWJlclxuICBtYWlsZXI6IElNYWlsZXJcbn1cblxuZnVuY3Rpb24gaXNDcm9uVmFsaWQoZnJlcTogc3RyaW5nKTogYm9vbGVhbiB7XG4gIGNvbnN0IGNyb25yZWdleCA9IG5ldyBSZWdFeHAoXG4gICAgL14oXFwqfChbMC05XXwxWzAtOV18MlswLTldfDNbMC05XXw0WzAtOV18NVswLTldKXxcXCpcXC8oWzAtOV18MVswLTldfDJbMC05XXwzWzAtOV18NFswLTldfDVbMC05XSkpIChcXCp8KFswLTldfDFbMC05XXwyWzAtM10pfFxcKlxcLyhbMC05XXwxWzAtOV18MlswLTNdKSkgKFxcKnwoWzEtOV18MVswLTldfDJbMC05XXwzWzAtMV0pfFxcKlxcLyhbMS05XXwxWzAtOV18MlswLTldfDNbMC0xXSkpIChcXCp8KFsxLTldfDFbMC0yXSl8XFwqXFwvKFsxLTldfDFbMC0yXSkpIChcXCp8KFswLTZdKXxcXCpcXC8oWzAtNl0pKSQvXG4gIClcbiAgcmV0dXJuIGNyb25yZWdleC50ZXN0KGZyZXEpXG59XG5cbmV4cG9ydCBkZWZhdWx0IFNjaGVkdWxlclxuIl19
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU2NoZWR1bGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL1NjaGVkdWxlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLDBEQUE0QjtBQUM1Qix5Q0FBOEI7QUFDOUIsc0RBQW1EO0FBRW5ELDREQUFtQztBQUVuQyxNQUFNLFNBQVM7SUF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pbmcpIHtcbiAgICAgIGxvZ2dlci5sb2cobGV2ZWwsIG1lc3NhZ2UpXG4gICAgfVxuICB9XG59XG5cbmV4cG9ydCBpbnRlcmZhY2UgSVNjaGVkdWxlciB7XG4gIGV4cHJlc3Npb246IHN0cmluZ1xuICBtYXhBdHRlbXBzOiBudW1iZXJcbiAgbWFpbGVyOiBJTWFpbGVyXG4gIGxvZ2dpbmc6IGJvb2xlYW5cbn1cblxuZnVuY3Rpb24gaXNDcm9uVmFsaWQoZnJlcTogc3RyaW5nKTogYm9vbGVhbiB7XG4gIGNvbnN0IGNyb25yZWdleCA9IG5ldyBSZWdFeHAoXG4gICAgL14oXFwqfChbMC05XXwxWzAtOV18MlswLTldfDNbMC05XXw0WzAtOV18NVswLTldKXxcXCpcXC8oWzAtOV18MVswLTldfDJbMC05XXwzWzAtOV18NFswLTldfDVbMC05XSkpIChcXCp8KFswLTldfDFbMC05XXwyWzAtM10pfFxcKlxcLyhbMC05XXwxWzAtOV18MlswLTNdKSkgKFxcKnwoWzEtOV18MVswLTldfDJbMC05XXwzWzAtMV0pfFxcKlxcLyhbMS05XXwxWzAtOV18MlswLTldfDNbMC0xXSkpIChcXCp8KFsxLTldfDFbMC0yXSl8XFwqXFwvKFsxLTldfDFbMC0yXSkpIChcXCp8KFswLTZdKXxcXCpcXC8oWzAtNl0pKSQvXG4gIClcbiAgcmV0dXJuIGNyb25yZWdleC50ZXN0KGZyZXEpXG59XG5cbmV4cG9ydCBkZWZhdWx0IFNjaGVkdWxlclxuIl19
{
"name": "nodemailer-sequelize-queue",
"version": "0.0.10",
"version": "0.0.13",
"description": "Queue for mails with nodemailer and cron scheduler",

@@ -17,3 +17,8 @@ "main": "./dist/index.js",

"version": "npm run format && git add -A src",
"postversion": "git push --set-upstream origin master && git push --set-upstream origin master --tags"
"postversion": "git push --set-upstream origin master && git push --set-upstream origin master --tags",
"commit:example": "echo 'npm run commit -- 'v.1.0.1: Fixes'",
"commit:patch": "npm version patch --no-git-tag-version --force",
"commit:minor": "npm version minor --no-git-tag-version --force",
"commit:major": "npm version major --no-git-tag-version --force",
"commit": "git add . && git commit -m "
},

@@ -20,0 +25,0 @@ "repository": {

# Nodemailer sequelize queue
[Npm package](https://www.npmjs.com/package/nodemailer-sequelize-queue)
### This package allows to queue email and process it later by schedule using [Nodemailer](https://www.npmjs.com/package/nodemailer) for sending mails, [Sequelize](https://www.npmjs.com/package/sequelize) for save queue to database and [Node cron](https://www.npmjs.com/package/sequelize) for scheduling.
## Getting Started

@@ -12,3 +14,5 @@

```
or use yarn
```console

@@ -18,5 +22,6 @@ yarn add nodemailer-sequelize-queue

## Usage
## Usage
1. Create NodemailerSequelizeQueue instance
```console

@@ -54,7 +59,11 @@ import NodemailerSequelizeQueue from 'nodemailer-sequelize-queue'

```
2. Run cron schedule for sending mail (Only one time in root of the system)
```console
queue.initScheduler()
```
3. Add mail to queue
```console

@@ -61,0 +70,0 @@ queue.queueMail({

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc