2013-01-19 18:24:18 +09:00
|
|
|
sendEmail = function(to, subject, text, html){
|
|
|
|
|
2013-10-23 10:21:08 +08:00
|
|
|
// TODO: limit who can send emails
|
|
|
|
// TODO: fix this error: Error: getaddrinfo ENOTFOUND
|
|
|
|
|
|
|
|
var from = getSetting('defaultEmail', 'noreply@example.com');
|
2013-01-19 18:24:18 +09:00
|
|
|
var siteName = getSetting('title');
|
|
|
|
var subject = '['+siteName+'] '+subject
|
|
|
|
|
2013-01-19 23:01:43 +09:00
|
|
|
console.log('sending email…');
|
|
|
|
console.log(from)
|
|
|
|
console.log(to)
|
|
|
|
console.log(subject)
|
|
|
|
console.log(text)
|
|
|
|
console.log(html)
|
2013-01-19 18:24:18 +09:00
|
|
|
|
|
|
|
Email.send({
|
|
|
|
from: from,
|
|
|
|
to: to,
|
|
|
|
subject: subject,
|
|
|
|
text: text,
|
|
|
|
html: html
|
|
|
|
});
|
2013-01-19 22:09:47 +09:00
|
|
|
};
|