Skip to content

Instantly share code, notes, and snippets.

@henryboldi
Created May 11, 2014 17:09
Show Gist options
  • Save henryboldi/ad82395bd8cc865f9658 to your computer and use it in GitHub Desktop.
Save henryboldi/ad82395bd8cc865f9658 to your computer and use it in GitHub Desktop.
bugRepot: function(req, res){
var bugObj = {
browserInfo: req.param('browserInfo'),
message: req.param('message'),
}
var smtpTransport = nodemailer.createTransport("SMTP",{
service: "Mandrill",
auth: {
user: "paulvorobyev@gmail.com",
pass: "p5HhcYn9ZPg5dBsnQBi4NA" // Please for the love of jesus if you make this public hide the goddamn API key
}
});
var mailOptions = {
from: "BUGGGG OMG<henry@hackerbracket.com>",
to: values.email,
subject: "Bug Report by " + req.session.User.name,
text: "browserInfo: \n" + bugObj['browserInfo'] + "\n\nMessage:\n" + bugObj['message'] + "\n\n User Info: \n" + req.session.User,
}
smtpTransport.sendMail(mailOptions, function(error, response){
if(error){
console.log(error);
}else{
console.log("Message sent: " + response.message);
}
smtpTransport.close();
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment