@ -47,7 +47,8 @@ router.post('/recover', parseJSON, validate.validEmail('email'), async (req, res
if(user)
email.sendPasswordReset(user)
else
email.sendNoSuchAccount(req.body.email)
res.end()
})
@ -33,3 +33,16 @@ email.sendPasswordReset = async user => {
await sendgrid.send(msg)
}
email.sendNoSuchAccount = async email => {
const msg = {
to: email,
from: {email: 'accounts@email.societyofsocks.us', name: 'Society of Socks'},
templateId: 'd-34bb8b2a94264092a47d1f03999be836',
dynamic_template_data: {
emailAddress: email