Emailing
This commit is contained in:
@@ -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();
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user