Added sendgrid package and user/pass to config
This commit is contained in:
@ -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);
|
||||
});
|
||||
};
|
@ -15,6 +15,7 @@
|
||||
"passport-local": "*",
|
||||
"passport-facebook": "*",
|
||||
"passport-google-oauth": "*",
|
||||
"sendgrid": "*",
|
||||
"tumblrwks": "*",
|
||||
"underscore": "*"
|
||||
}
|
||||
|
Reference in New Issue
Block a user