From 727c96e5dafcdbc315f8934a7a2d434be2a2a00c Mon Sep 17 00:00:00 2001 From: Matteo Pagliazzi Date: Sun, 16 Nov 2014 10:56:18 +0100 Subject: [PATCH] fix(config): switch to new config style for emails, cc @lefnire --- config.json.example | 9 +++++---- src/utils.js | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/config.json.example b/config.json.example index 19b58c2a1d..aa70349d0a 100644 --- a/config.json.example +++ b/config.json.example @@ -20,9 +20,11 @@ "NEW_RELIC_APPLICATION_ID":"NEW_RELIC_APPLICATION_ID", "NEW_RELIC_API_KEY":"NEW_RELIC_API_KEY", "GA_ID": "GA_ID", - "EMAIL_SERVER_URL": "http://example.com", - "EMAIL_SERVER_AUTH_USER": "user", - "EMAIL_SERVER_AUTH_PASSWORD": "password", + "EMAIL_SERVER": { + "url": "http://example.com", + "authUser": "user", + "authPassword": "password" + }, "S3":{ "bucket":"bucket", "accessKeyId":"accessKeyId", @@ -33,5 +35,4 @@ "client_id":"client_id", "client_secret":"client_secret" } - } diff --git a/src/utils.js b/src/utils.js index 06ee14eb9d..0789038b5e 100644 --- a/src/utils.js +++ b/src/utils.js @@ -38,11 +38,11 @@ module.exports.txnEmail = function(mailingInfo, emailType, variables){ if (mailingInfo._id) mailingInfo = getMailingInfo(mailingInfo); if (!mailingInfo.email) return; request({ - url: nconf.get('EMAIL_SERVER_URL') + '/job', + url: nconf.get('EMAIL_SERVER:url') + '/job', method: 'POST', auth: { - user: nconf.get('EMAIL_SERVER_AUTH_USER'), - pass: nconf.get('EMAIL_SERVER_AUTH_PASSWORD') + user: nconf.get('EMAIL_SERVER:authUser'), + pass: nconf.get('EMAIL_SERVER:authPassword') }, json: { type: 'email',