Skip to content

Instantly share code, notes, and snippets.

@funador
Last active November 19, 2020 13:17
Show Gist options
  • Save funador/b1be241c329f2dfd440fd2291134b61d to your computer and use it in GitHub Desktop.
Save funador/b1be241c329f2dfd440fd2291134b61d to your computer and use it in GitHub Desktop.
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