Skip to content

Commit

Permalink
added the resend contact email & fixed lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Kashyap1ankit committed Dec 22, 2024
1 parent 288db7d commit a395895
Show file tree
Hide file tree
Showing 30 changed files with 11,372 additions and 3,706 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
11 changes: 3 additions & 8 deletions @/components/ui/alert.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import * as React from "react"
export function Alert({
children,
className,
variant,
...props
}) {
import * as React from "react";
export function Alert({ children, className, variant, ...props }) {
return (
<div
className={`${className} rounded-lg border p-4 ${
Expand Down Expand Up @@ -45,4 +40,4 @@ export function AlertDescription({ children, className, ...props }) {
);
}

AlertDescription.displayName = "AlertDescription";
AlertDescription.displayName = "AlertDescription";
103 changes: 0 additions & 103 deletions @/components/ui/toast.jsx

This file was deleted.

35 changes: 0 additions & 35 deletions @/components/ui/toaster.jsx

This file was deleted.

155 changes: 0 additions & 155 deletions @/components/ui/use-toast.js

This file was deleted.

26 changes: 26 additions & 0 deletions app/action/sendContactEmail.js
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 }),
});
console.log(res);
if (!res.data) throw new Error(res.error.name);

return {
status: 200,
message: "Sent successfully",
};
} catch (error) {
return {
status: 400,
message: error.message,
};
}
}
Loading

0 comments on commit a395895

Please sign in to comment.