HerzaJ commited on
Commit
507fe9d
·
verified ·
1 Parent(s): 0ebb0d2

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +16 -7
index.js CHANGED
@@ -811,13 +811,22 @@ const resend = new Resend(process.env.RESEND_API_KEY);
811
  </body>
812
  </html>
813
  `;
814
-
815
- await resend.emails.send({
816
- from: 'onboarding@resend.dev',
817
- to: email,
818
- subject: 'DashX - Email Verification',
819
- html: emailTemplate
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,