summaryrefslogtreecommitdiff
path: root/src/pages/api/activation-request.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages/api/activation-request.js')
-rw-r--r--src/pages/api/activation-request.js31
1 files changed, 0 insertions, 31 deletions
diff --git a/src/pages/api/activation-request.js b/src/pages/api/activation-request.js
deleted file mode 100644
index 3f33875c..00000000
--- a/src/pages/api/activation-request.js
+++ /dev/null
@@ -1,31 +0,0 @@
-import apiOdoo from "@/core/utils/apiOdoo";
-import mailer from "@/core/utils/mailer";
-
-export default async function handler(req, res) {
- try {
- const { email } = req.body;
- let result = await apiOdoo(
- 'POST',
- '/api/v1/user/activation-request',
- {email}
- );
- if (result.activation_request) {
- mailer.sendMail({
- from: 'sales@indoteknik.com',
- to: result.user.email,
- subject: 'Permintaan Aktivasi Akun Indoteknik',
- html: `
- <h1>Permintaan Aktivasi Akun Indoteknik</h1>
- <br>
- <p>Aktivasi akun anda melalui link berikut: <a href="${process.env.SELF_HOST}/activate?token=${result.token}">Aktivasi Akun</a></p>
- `
- });
- }
- delete result.user;
- delete result.token;
- res.status(200).json(result);
- } catch (error) {
- console.log(error);
- res.status(400).json({ error: error.message });
- }
-} \ No newline at end of file