Update index.js
Browse files
index.js
CHANGED
|
@@ -811,13 +811,22 @@ const resend = new Resend(process.env.RESEND_API_KEY);
|
|
| 811 |
</body>
|
| 812 |
</html>
|
| 813 |
`;
|
| 814 |
-
|
| 815 |
-
|
| 816 |
-
|
| 817 |
-
|
| 818 |
-
|
| 819 |
-
|
| 820 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 821 |
|
| 822 |
res.json({
|
| 823 |
success: true,
|
|
|
|
| 811 |
</body>
|
| 812 |
</html>
|
| 813 |
`;
|
| 814 |
+
const EMAIL_API_URL = process.env.API_URL
|
| 815 |
+
const EMAIL_API_KEY = process.env.EMAIL_API_KEY;
|
| 816 |
+
|
| 817 |
+
|
| 818 |
+
const response = await fetch(EMAIL_API_URL, {
|
| 819 |
+
method: 'POST',
|
| 820 |
+
headers: {
|
| 821 |
+
'Content-Type': 'application/json',
|
| 822 |
+
'x-api-key': EMAIL_API_KEY
|
| 823 |
+
},
|
| 824 |
+
body: JSON.stringify({
|
| 825 |
+
target: email,
|
| 826 |
+
subject: 'DashX - Email Verification',
|
| 827 |
+
html: emailTemplate
|
| 828 |
+
})
|
| 829 |
+
});
|
| 830 |
|
| 831 |
res.json({
|
| 832 |
success: true,
|