Fixed email option issues
This commit is contained in:
@@ -6,7 +6,8 @@ exports.sendRunEmails = function(runData) {
|
||||
+ runData.name + "'! \n\n Put in your order here:\nhttp://www.lunchrun.me/#/run/"
|
||||
+ runData.id + "/order/";
|
||||
var options = {
|
||||
from: runData.creatorName + " <" + runData.creatorEmail + ">",
|
||||
fromname: runData.creatorName + " via LunchRun.me",
|
||||
from: sails.config.email.fromAddress,
|
||||
subject: "You've been invited to a lunch run!",
|
||||
replyto: runData.creatorEmail
|
||||
};
|
||||
@@ -15,12 +16,13 @@ exports.sendRunEmails = function(runData) {
|
||||
for (var idx in runData.invitees) {
|
||||
var invitee = runData.invitees[idx];
|
||||
var specificOptions = options;
|
||||
specificOptions.to = invitee.name + " <" + invitee.email + ">";
|
||||
specificOptions.to = invitee.email;
|
||||
specificOptions.toname = invitee.name;
|
||||
specificOptions.text = emailText + invitee.name;
|
||||
|
||||
console.log(specificOptions);
|
||||
|
||||
sendgrid.send(specificOptions, function(err, response) {
|
||||
sg.send(specificOptions, function(err, response) {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
} else {
|
||||
@@ -28,6 +30,4 @@ exports.sendRunEmails = function(runData) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
transport.close();
|
||||
};
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
//
|
||||
module.exports.email = {
|
||||
apiUser: "benjaminramey",
|
||||
apiKey: "AVidasUPthub6pY3fFGe"
|
||||
apiKey: "AVidasUPthub6pY3fFGe",
|
||||
fromAddress: "ben.ramey@gmail.com"
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user