Sprucing up homepage, real e-mail

This commit is contained in:
Ben Ramey
2014-03-25 22:10:41 -05:00
parent b9917e6027
commit 467a966bc8
4 changed files with 60 additions and 61 deletions

View File

@@ -40,30 +40,29 @@ module.exports = {
}
});
var inviteeEmails = [];
for (var i in values.invitees) {
var invitee = values.invitees[i];
var emailStr = invitee.name + " <" + invitee.email + ">";
inviteeEmails.push(emailStr);
}
var options = {
from: values.creatorName + " <" + values.creatorEmail + ">",
to: inviteeEmails.join(","),
subject: "A lunch run!",
text: "You've been invited to a lunch run!"
subject: "You've been invited to a lunch run!",
text: "You've been invited to " + values.creatorName + "'s lunch run: '"
+ values.name + "'! \n\n Put in your order here:\nhttp://www.lunchrun.me/#/run/"
+ values.id + "/order/"
};
console.log(options);
for (var idx in values.invitees) {
var invitee = values.invitees[idx];
var specificOptions = options;
specificOptions.to = invitee.name + " <" + invitee.email + ">";
specificOptions.text += invitee.name;
transport.sendMail(options, function(err, response) {
if (err) {
console.log(err);
} else {
console.log("message sent from: " + values.creatorEmail);
}
});
console.log(specificOptions);
transport.sendMail(specificOptions, function(err, response) {
if (err) {
console.log(err);
} else {
console.log("message sent from: " + values.creatorEmail);
}
});
}
transport.close();