diff --git a/src/application/app.js b/src/application/app.js index da3b4c8f..5cf49533 100644 --- a/src/application/app.js +++ b/src/application/app.js @@ -43,7 +43,7 @@ async function mcodeApp(Client, fromDate, toDate, config, pathToRunLogs, debug, // If we have notification information, send an emailNotification const { notificationInfo } = config; - if (notificationInfo) { + if (notificationInfo && Object.keys(notificationInfo).length > 0) { const notificationErrors = zipErrors(totalExtractionErrors); try { await sendEmailNotification(notificationInfo, notificationErrors, debug); diff --git a/src/helpers/schemas/config.schema.json b/src/helpers/schemas/config.schema.json index be659c9c..9a56df53 100644 --- a/src/helpers/schemas/config.schema.json +++ b/src/helpers/schemas/config.schema.json @@ -79,10 +79,13 @@ "type": "boolean" } }, - "required": [ - "host", - "to" - ] + "dependencies": { + "host": { "required": ["to"] }, + "to": { "required": ["host"] }, + "from": { "required": ["host", "to"] }, + "port": { "required": ["host", "to"] }, + "tlsRejectUnauthorized": { "required": ["host", "to"] } + } }, "extractor": { "title": "Extractor",