Created
May 11, 2014 17:09
-
-
Save henryboldi/ad82395bd8cc865f9658 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bugRepot: function(req, res){ | |
var bugObj = { | |
browserInfo: req.param('browserInfo'), | |
message: req.param('message'), | |
} | |
var smtpTransport = nodemailer.createTransport("SMTP",{ | |
service: "Mandrill", | |
auth: { | |
user: "[email protected]", | |
pass: "p5HhcYn9ZPg5dBsnQBi4NA" // Please for the love of jesus if you make this public hide the goddamn API key | |
} | |
}); | |
var mailOptions = { | |
from: "BUGGGG OMG<[email protected]>", | |
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