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) {
|
exports.getContact = function(req, res) {
|
||||||
res.render('contact', {
|
res.render('contact', {
|
||||||
title: 'Contact',
|
title: 'Contact',
|
||||||
@ -11,4 +14,14 @@ exports.postContact = function(req, res) {
|
|||||||
var lastName = req.body.lastName;
|
var lastName = req.body.lastName;
|
||||||
var email = req.body.email;
|
var email = req.body.email;
|
||||||
var body = req.body.contactBody;
|
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-local": "*",
|
||||||
"passport-facebook": "*",
|
"passport-facebook": "*",
|
||||||
"passport-google-oauth": "*",
|
"passport-google-oauth": "*",
|
||||||
|
"sendgrid": "*",
|
||||||
"tumblrwks": "*",
|
"tumblrwks": "*",
|
||||||
"underscore": "*"
|
"underscore": "*"
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user