diff --git a/api/models/Run.js b/api/models/Run.js index c8b9deb..7a86dae 100644 --- a/api/models/Run.js +++ b/api/models/Run.js @@ -41,13 +41,22 @@ module.exports = { }); var inviteeEmails = []; + for (var i in values.invitees) { - inviteeEmails.push(i.email); + var invitee = values.invitees[i]; + var emailStr = invitee.name + " <" + invitee.email + ">"; + inviteeEmails.push(emailStr); } + var options = { from: values.creatorName + " <" + values.creatorEmail + ">", - to: inviteeEmails + to: inviteeEmails.join(","), + subject: "A lunch run!", + text: "You've been invited to a lunch run!" }; + + console.log(options); + transport.sendMail(options, function(err, response) { if (err) { console.log(err); @@ -60,5 +69,4 @@ module.exports = { next(); }, - };