aboutsummaryrefslogtreecommitdiffstats
path: root/pages/api/verify.js
diff options
context:
space:
mode:
Diffstat (limited to 'pages/api/verify.js')
-rw-r--r--pages/api/verify.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/pages/api/verify.js b/pages/api/verify.js
index 89bd4cd..edcc7a9 100644
--- a/pages/api/verify.js
+++ b/pages/api/verify.js
@@ -2,7 +2,7 @@ import dbConnect from 'configs/dbConnect'
import sendMail from 'configs/sendMail'
import User from 'models/User'
import withSession from 'hocs/withSession'
-import { subject, text, html } from 'helpers/email'
+import mailData from 'helpers/email'
export default withSession(async (req, res) => {
await dbConnect()
@@ -16,7 +16,7 @@ export default withSession(async (req, res) => {
const key = await User.getVerificationKey(email)
if (!key) { throw new Error('Something went wrong') }
- const response = await sendMail(email, subject(l), text(l, key), html(l, key))
+ const response = await sendMail({to: email, ...mailData('v', l, key)})
if (!response?.accepted?.length) { throw new Error('Something went wrong') }
res.status(204).send()