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

@nodebb-community/nodebb-plugin-emailer-mailjet

Package Overview
Dependencies
Maintainers
9
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nodebb-community/nodebb-plugin-emailer-mailjet - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

50

library.js

@@ -1,9 +0,9 @@

var winston = require.main.require('winston');
var Meta = require.main.require('./src/meta');
const winston = require.main.require('winston');
const Meta = require.main.require('./src/meta');
var Emailer = module.exports;
var Mailjet = require('node-mailjet');
var server;
const Emailer = module.exports;
const { Client } = require('node-mailjet');
let mailJet;
Emailer.init = function(params, callback) {
Emailer.init = async function (params) {
function render(req, res, next) {

@@ -15,24 +15,23 @@ res.render('admin/plugins/emailer-mailjet', {

Meta.settings.get('mailjet', function(err, settings) {
if (!err && settings && settings.apiKey && settings.secretKey) {
server = Mailjet.apiConnect(settings.apiKey, settings.secretKey);
} else {
winston.error('[plugins/emailer-mailjet] API key or SECRET Key not set!');
}
});
const settings = await Meta.settings.get('mailjet');
if (settings && settings.apiKey && settings.secretKey) {
mailJet = new Client({
apiKey: settings.apiKey,
apiSecret: settings.secretKey
});
} else {
winston.error('[plugins/emailer-mailjet] API key or SECRET Key not set!');
}
params.router.get('/admin/plugins/emailer-mailjet', params.middleware.admin.buildHeader, render);
params.router.get('/api/admin/plugins/emailer-mailjet', render);
callback();
};
Emailer.send = function(data, callback) {
if (!server) {
Emailer.send = async function (data) {
if (!mailJet) {
winston.error('[emailer.mailjet] Mailjet is not set up properly!')
return callback(null, data);
return data;
}
var sendEmail = server.post('send', { version: 'v3.1' });
var emailData = {
const emailData = {
Messages: [

@@ -56,10 +55,5 @@ {

sendEmail
.request(emailData)
.then(() => {
callback(null, data);
})
.catch((err) => {
callback(err);
});
await mailJet.post('send', { version: 'v3.1' })
.request(emailData);
return data;
};

@@ -66,0 +60,0 @@

{
"name": "@nodebb-community/nodebb-plugin-emailer-mailjet",
"version": "3.0.0",
"version": "3.0.1",
"description": "An emailer plugin for NodeBB using Mailjet as a third party service",

@@ -5,0 +5,0 @@ "main": "index.js",

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