From c912c4c72242383d70addb07ecd2a6e4afffd547 Mon Sep 17 00:00:00 2001 From: Tadas Varanauskas Date: Tue, 25 May 2021 16:32:29 +0200 Subject: [PATCH 1/2] Version bump --- package.json | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index a19c3ac..84942ff 100644 --- a/package.json +++ b/package.json @@ -6,16 +6,19 @@ "scripts": { "test": "grunt" }, - "keywords": ["nodemailer", "sendgrid"], + "keywords": [ + "nodemailer", + "sendgrid" + ], "author": "Andris Reinman", "license": "MIT", "dependencies": { - "@sendgrid/mail": "^6.2.1" + "@sendgrid/mail": "^7.4.4" }, "devDependencies": { "eslint-config-nodemailer": "^1.2.0", "grunt": "^1.0.2", - "grunt-eslint": "^20.1.0", - "nodemailer": "^4.6.3" + "grunt-eslint": "^23.0.0", + "nodemailer": "^6.6.1" } } From f286333032433d3a1d5534d5abdaf6f46966c7c2 Mon Sep 17 00:00:00 2001 From: Tadas Varanauskas Date: Tue, 25 May 2021 16:33:01 +0200 Subject: [PATCH 2/2] Isolate sendgrid used by transport, so multiple transports could use multiple instances --- index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index e7c8d33..2096098 100644 --- a/index.js +++ b/index.js @@ -1,15 +1,16 @@ 'use strict'; const packageData = require('./package.json'); -const sgMail = require('@sendgrid/mail'); +const { MailService } = require('@sendgrid/mail'); class SendGridTransport { constructor(options) { this.options = options || {}; this.name = packageData.name; this.version = packageData.version; + this.sgMail = new MailService(); if (options.apiKey) { - sgMail.setApiKey(options.apiKey); + this.sgMail.setApiKey(options.apiKey); } } @@ -123,7 +124,7 @@ class SendGridTransport { } } - sgMail.send(msg, callback); + this.sgMail.send(msg, callback); }); } }