Emailing
This commit is contained in:
@@ -41,13 +41,22 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
|
|
||||||
var inviteeEmails = [];
|
var inviteeEmails = [];
|
||||||
|
|
||||||
for (var i in values.invitees) {
|
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 = {
|
var options = {
|
||||||
from: values.creatorName + " <" + values.creatorEmail + ">",
|
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) {
|
transport.sendMail(options, function(err, response) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
@@ -60,5 +69,4 @@ module.exports = {
|
|||||||
|
|
||||||
next();
|
next();
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user