Sprucing up homepage, real e-mail
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user