-
Notifications
You must be signed in to change notification settings - Fork 0
/
mailer.js
41 lines (33 loc) · 885 Bytes
/
mailer.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Generated by CoffeeScript 1.6.3
(function() {
var Mailer, emailer, exports;
emailer = require("nodemailer");
Mailer = (function() {
function Mailer(opts) {
this.opts = opts;
}
Mailer.prototype.send = function(subject, message, cb) {
var messageData, transport;
messageData = {
to: this.opts.mailto,
from: "Me",
subject: subject,
html: message,
generateTextFromHTML: false
};
transport = this.getTransport();
return transport.sendMail(messageData, cb);
};
Mailer.prototype.getTransport = function() {
return emailer.createTransport("SMTP", {
service: "Gmail",
auth: {
user: this.opts.sender.user,
pass: this.opts.sender.pass
}
});
};
return Mailer;
})();
exports = module.exports = Mailer;
}).call(this);