Added sendgrid package and user/pass to config

This commit is contained in:
Sahat Yalkabov
2013-11-30 13:14:29 -05:00
parent d023e2f997
commit 2778848043
2 changed files with 14 additions and 0 deletions

View File

@ -1,3 +1,6 @@
var config = require('../config/config.json');
var sendgrid = require('sendgrid')(config.sendgrid.user, config.sendgrid.password);
exports.getContact = function(req, res) {
res.render('contact', {
title: 'Contact',
@ -11,4 +14,14 @@ exports.postContact = function(req, res) {
var lastName = req.body.lastName;
var email = req.body.email;
var body = req.body.contactBody;
sendgrid.send({
to: 'example@example.com',
from: 'other@example.com',
subject: 'Hello World',
text: 'My first email through SendGrid.'
}, function(err, json) {
if (err) { return console.error(err); }
console.log(json);
});
};

View File

@ -15,6 +15,7 @@
"passport-local": "*",
"passport-facebook": "*",
"passport-google-oauth": "*",
"sendgrid": "*",
"tumblrwks": "*",
"underscore": "*"
}