This commit is contained in:
Martin Donnelly 2016-02-12 10:47:52 +00:00
parent af48d9d469
commit 1c84148af2
2 changed files with 7 additions and 3 deletions

View File

@ -2,7 +2,7 @@
* Created by marti on 30/01/2016.
*/
var http = require('http'), request = require('request'), cheerio = require('cheerio'), Forecast = require('forecast.io'), util = require('util'), UltraSES = require('ultrases'), cron = require('node-cron');
var jade = require('jade'), _ = require('lodash');
var jade = require('jade'), _ = require('lodash'), dateFormat = require('dateformat');
var jsonfile = require('jsonfile');
var todayCache = {
@ -203,12 +203,15 @@ module.exports = {
;
function sendEmail() {
var now = new Date();
var email = {
to: 'martind2000@gmail.com',
subject: 'Today'
subject: 'Today - ' + dateFormat(now, "dddd, mmmm dS, yyyy")
};
var template = {file: 'jade/today.jade', locals: todayCache};
var template = {file: 'lib/jade/today.jade', locals: todayCache};
mailer.sendTemplate(email, template, function (err) {
if (err) throw err;
console.log('compiled template email sent');

View File

@ -3,6 +3,7 @@
"version": "0.1.1",
"devDependencies": {
"cheerio": "^0.19.0",
"dateformat": "^1.0.12",
"ejs": "^2.3.4",
"forecast.io": "0.0.9",
"htmlparser": "^1.7.7",