From f4a6440b71d58db09c800c20b6bde4f8a7a275e2 Mon Sep 17 00:00:00 2001 From: Scisco Date: Thu, 17 Jul 2014 13:09:05 -0400 Subject: Added an activate key for the email in config and code --- config.sample.json | 3 ++- jekyll-hook.js | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/config.sample.json b/config.sample.json index dee6f1b..9b5c601 100644 --- a/config.sample.json +++ b/config.sample.json @@ -1,12 +1,13 @@ { "gh_server": "github.com", "temp": "/home/ubuntu/jekyll-hook", - "public-repo": True, + "public-repo": true, "scripts": { "build": "./scripts/build.sh", "publish": "./scripts/publish.sh" }, "email": { + "isActivated": false, "user": "", "password": "", "host": "", diff --git a/jekyll-hook.js b/jekyll-hook.js index 32359e2..80db6fd 100755 --- a/jekyll-hook.js +++ b/jekyll-hook.js @@ -112,13 +112,15 @@ function run(file, params, cb) { } function send(body, subject, data) { - if (config.email && data.pusher.email) { - var message = { - text: body, - from: config.email.user, - to: data.pusher.email, - subject: subject - }; - mailer.send(message, function(err) { if (err) console.warn(err); }); + if (config.email.isActivated) { + if (config.email && data.pusher.email) { + var message = { + text: body, + from: config.email.user, + to: data.pusher.email, + subject: subject + }; + mailer.send(message, function(err) { if (err) console.warn(err); }); + } } } -- cgit v1.2.3