Added email templating, and user welcome email

This commit is contained in:
Jori Lallo
2017-11-12 15:02:23 -08:00
parent 272cc158ea
commit 348e5f0b20
17 changed files with 463 additions and 14 deletions

19
server/mailer.test.js Normal file
View File

@@ -0,0 +1,19 @@
/* eslint-disable flowtype/require-valid-file-annotation */
import { Mailer } from './mailer';
describe('Mailer', () => {
let fakeMailer;
let sendMailOutput;
beforeEach(() => {
fakeMailer = new Mailer();
fakeMailer.transporter = {
sendMail: output => (sendMailOutput = output),
};
});
test('#welcome', () => {
fakeMailer.welcome('user@example.com');
expect(sendMailOutput).toMatchSnapshot();
});
});