diff options
| author | Wes Bos <wesbos@gmail.com> | 2018-08-14 12:01:14 -0400 |
|---|---|---|
| committer | Wes Bos <wesbos@gmail.com> | 2018-08-14 12:01:14 -0400 |
| commit | 268e7cee101a1beba0e80af3550fe83ab56fdd04 (patch) | |
| tree | d96aacaa8333c2b39c3e63fd1aaa937f82eac0d0 /stepped-solutions/32/backend/src/mail.js | |
| parent | ebb84f1f01396cf75e7fb70bb0e2987bbc0b14b2 (diff) | |
31 and 32
Diffstat (limited to 'stepped-solutions/32/backend/src/mail.js')
| -rwxr-xr-x | stepped-solutions/32/backend/src/mail.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/stepped-solutions/32/backend/src/mail.js b/stepped-solutions/32/backend/src/mail.js new file mode 100755 index 0000000..5274310 --- /dev/null +++ b/stepped-solutions/32/backend/src/mail.js @@ -0,0 +1,28 @@ +const nodemailer = require('nodemailer'); + +const transport = nodemailer.createTransport({ + host: process.env.MAIL_HOST, + port: process.env.MAIL_PORT, + auth: { + user: process.env.MAIL_USER, + pass: process.env.MAIL_PASS, + }, +}); + +const makeANiceEmail = text => ` + <div className="email" style=" + border: 1px solid black; + padding: 20px; + font-family: sans-serif; + line-height: 2; + font-size: 20px; + "> + <h2>Hello There!</h2> + <p>${text}</p> + + <p>😘, Wes Bos</p> + </div> +`; + +exports.transport = transport; +exports.makeANiceEmail = makeANiceEmail; |
