diff --git a/next.config.js b/next.config.js
index 4a6bb16f..771f71d2 100644
--- a/next.config.js
+++ b/next.config.js
@@ -1,4 +1,5 @@
/** @type {import('next').NextConfig} */
+const websiteUrl = process.env.NODE_ENV === 'production' ? "https://encoach.com" : "http://localhost:3000";
const nextConfig = {
reactStrictMode: true,
output: "standalone",
@@ -8,7 +9,7 @@ const nextConfig = {
source: "/api/packages",
headers: [
{key: "Access-Control-Allow-Credentials", value: "false"},
- {key: "Access-Control-Allow-Origin", value: "https://encoach.com"},
+ {key: "Access-Control-Allow-Origin", value: websiteUrl},
{
key: "Access-Control-Allow-Methods",
value: "GET",
@@ -19,6 +20,21 @@ const nextConfig = {
},
],
},
+ {
+ source: "/api/tickets",
+ headers: [
+ {key: "Access-Control-Allow-Credentials", value: "false"},
+ {key: "Access-Control-Allow-Origin", value: websiteUrl},
+ {
+ key: "Access-Control-Allow-Methods",
+ value: "POST,OPTIONS",
+ },
+ {
+ key: "Access-Control-Allow-Headers",
+ value: "Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date",
+ },
+ ],
+ },
];
},
};
diff --git a/src/email/templates/ticketStatusCompleted.handlebars b/src/email/templates/ticketStatusCompleted.handlebars
new file mode 100644
index 00000000..8b53d5e2
--- /dev/null
+++ b/src/email/templates/ticketStatusCompleted.handlebars
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+

+
+ Your ticket has been completed!
+
+ Here is the ticket's information:
+
+
+ ID: {{id}}
+ Subject: {{subject}}
+ Reporter: {{reporter.name}} - {{reporter.email}}
+ Date: {{date}}
+ Type: {{type}}
+ Page: {{reportedFrom}}
+
+
+ Description: {{description}}
+
+
+
+
+ Thanks,
Your EnCoach team
+
+
+
+
diff --git a/src/hooks/useAcceptedTerms.tsx b/src/hooks/useAcceptedTerms.tsx
new file mode 100644
index 00000000..8bf2bf77
--- /dev/null
+++ b/src/hooks/useAcceptedTerms.tsx
@@ -0,0 +1,26 @@
+import React from "react";
+import Link from "next/link";
+import Checkbox from "@/components/Low/Checkbox";
+
+const useAcceptedTerms = () => {
+ const [acceptedTerms, setAcceptedTerms] = React.useState(false);
+
+ const renderCheckbox = () => (
+
+ I agree to the
+
+ {" "}
+ Terms and Conditions
+ {" "}
+ and
+
+ {" "}
+ Privacy Policy
+
+
+ );
+
+ return {acceptedTerms, renderCheckbox};
+};
+
+export default useAcceptedTerms;
diff --git a/src/pages/(register)/RegisterCorporate.tsx b/src/pages/(register)/RegisterCorporate.tsx
index 46d6a54b..1992e667 100644
--- a/src/pages/(register)/RegisterCorporate.tsx
+++ b/src/pages/(register)/RegisterCorporate.tsx
@@ -10,6 +10,7 @@ import { toast } from "react-toastify";
import { KeyedMutator } from "swr";
import Select from "react-select";
import moment from "moment";
+import useAcceptedTerms from "@/hooks/useAcceptedTerms";
interface Props {
isLoading: boolean;
@@ -40,6 +41,7 @@ export default function RegisterCorporate({
const [companyName, setCompanyName] = useState("");
const [companyUsers, setCompanyUsers] = useState(0);
const [subscriptionDuration, setSubscriptionDuration] = useState(1);
+ const {acceptedTerms, renderCheckbox} = useAcceptedTerms();
const { users } = useUsers();
@@ -257,7 +259,9 @@ export default function RegisterCorporate({
/>
-
+
+ {renderCheckbox()}
+