JavaScript style formatting.

SendGrid as a default service for contact form.
This commit is contained in:
Sahat Yalkabov
2014-02-11 10:46:39 -05:00
parent b6391fccf8
commit a987efea4a

View File

@ -1,16 +1,16 @@
var secrets = require('../config/secrets'); var secrets = require('../config/secrets');
var nodemailer = require("nodemailer"); var nodemailer = require("nodemailer");
var smtpTransport = nodemailer.createTransport("SMTP", { var smtpTransport = nodemailer.createTransport('SMTP', {
service: "Mailgun", // service: 'Mailgun',
auth: {
user: secrets.mailgun.login,
pass: secrets.mailgun.password
}
// service: "Sendgrid",
// auth: { // auth: {
// user: secrets.sendgrid.user, // user: secrets.mailgun.login,
// pass: secrets.sendgrid.password // pass: secrets.mailgun.password
// } // }
service: 'SendGrid',
auth: {
user: secrets.sendgrid.user,
pass: secrets.sendgrid.password
}
}); });
/** /**
@ -47,7 +47,7 @@ exports.postContact = function(req, res) {
var from = req.body.email; var from = req.body.email;
var name = req.body.name; var name = req.body.name;
var body = req.body.message; var body = req.body.message;
var to = 'you@email.com'; var to = 'your@email.com';
var subject = 'API Example | Contact Form'; var subject = 'API Example | Contact Form';
var mailOptions = { var mailOptions = {