Last active
November 19, 2020 13:17
-
-
Save funador/b1be241c329f2dfd440fd2291134b61d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { CLIENT_ORIGIN } = require('../config') | |
// This file is exporting an Object with a single key/value pair. | |
// However, because this is not a part of the logic of the application | |
// it makes sense to abstract it to another file. Plus, it is now easily | |
// extensible if the application needs to send different email templates | |
// (eg. unsubscribe) in the future. | |
module.exports = { | |
confirm: id => ({ | |
subject: 'React Confirm Email', | |
html: ` | |
<a href='${CLIENT_ORIGIN}/confirm/${id}'> | |
click to confirm email | |
</a> | |
`, | |
text: `Copy and paste this link: ${CLIENT_ORIGIN}/confirm/${id}` | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment