Skip to content

Commit 43ed191

Browse files
committed
mailer
1 parent f345c1d commit 43ed191

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

server/services/Mailer.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@ const sendgrid = require('sendgrid');
22
const helper = sendgrid.mail;
33
const keys = require('../config/keys');
44

5-
class Mailer extends helper.Mail {}
5+
class Mailer extends helper.Mail {
6+
constructor({ subject, recipients }, content) {
7+
super();
8+
9+
this.from_email = new helper.Email('no-reply@emaily.com');
10+
this.subject = subject;
11+
this.body = new helper.Content('text/html', content);
12+
this.recipients = this.formatAddresses(recipients);
13+
}
14+
}
615

716
module.exports = Mailer;

0 commit comments

Comments
 (0)