-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #159 from Kashyap1ankit/feat/san-29
added the resend contact email & fixed lint
- Loading branch information
Showing
30 changed files
with
14,907 additions
and
3,162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "next/core-web-vitals" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
"use server"; | ||
import { resend } from "../../lib/resend"; | ||
import ContactEmailTemplate from "../../components/Contatct/Contatc-email-format"; | ||
|
||
export async function sendContactEmail(username, fromEmail, message, subject) { | ||
try { | ||
const res = await resend.emails.send({ | ||
from: "Acme <[email protected]>", | ||
to: "[email protected]", | ||
subject: subject, | ||
html: ContactEmailTemplate({ username, message, fromEmail }), | ||
}); | ||
|
||
if (!res.data) throw new Error(res.error.name); | ||
|
||
return { | ||
status: 200, | ||
message: "Sent successfully", | ||
}; | ||
} catch (error) { | ||
return { | ||
status: 400, | ||
message: error.message, | ||
}; | ||
} | ||
} |
Oops, something went wrong.