diff --git a/apps/webapp/app/components/navigation/SideMenu.tsx b/apps/webapp/app/components/navigation/SideMenu.tsx
index 922d45d440..7c811d2acc 100644
--- a/apps/webapp/app/components/navigation/SideMenu.tsx
+++ b/apps/webapp/app/components/navigation/SideMenu.tsx
@@ -631,8 +631,6 @@ function V3ProjectSideMenu({
project: SideMenuProject;
organization: MatchedOrganization;
}) {
- const { alertsEnabled } = useFeatures();
-
return (
<>
@@ -685,15 +683,13 @@ function V3ProjectSideMenu({
to={v3DeploymentsPath(organization, project)}
data-action="deployments"
/>
- {alertsEnabled && (
-
- )}
+
("root");
- return routeMatch?.features ?? { isManagedCloud: false, v3Enabled: false, alertsEnabled: false };
+ return routeMatch?.features ?? { isManagedCloud: false, v3Enabled: false };
}
diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.alerts.new/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.alerts.new/route.tsx
index 1ee059a6af..4371d193b1 100644
--- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.alerts.new/route.tsx
+++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.alerts.new/route.tsx
@@ -23,6 +23,7 @@ import { Label } from "~/components/primitives/Label";
import SegmentedControl from "~/components/primitives/SegmentedControl";
import { Select, SelectItem } from "~/components/primitives/Select";
import { InfoIconTooltip } from "~/components/primitives/Tooltip";
+import { env } from "~/env.server";
import { useOrganization } from "~/hooks/useOrganizations";
import { useProject } from "~/hooks/useProject";
import { redirectWithSuccessMessage } from "~/models/message.server";
@@ -150,9 +151,13 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
const url = new URL(request.url);
const option = url.searchParams.get("option");
+ const emailAlertsEnabled =
+ env.ALERT_FROM_EMAIL !== undefined && env.ALERT_RESEND_API_KEY !== undefined;
+
return typedjson({
...results,
option: option === "slack" ? ("SLACK" as const) : undefined,
+ emailAlertsEnabled,
});
}
@@ -200,7 +205,7 @@ export const action = async ({ request, params }: ActionFunctionArgs) => {
export default function Page() {
const [isOpen, setIsOpen] = useState(false);
- const { slack, option } = useTypedLoaderData();
+ const { slack, option, emailAlertsEnabled } = useTypedLoaderData();
const lastSubmission = useActionData();
const navigation = useNavigation();
const navigate = useNavigate();
@@ -271,16 +276,23 @@ export default function Page() {
{currentAlertChannel === "EMAIL" ? (
-
-
-
- {channelValue.error}
-
+ emailAlertsEnabled ? (
+
+
+
+ {channelValue.error}
+
+ ) : (
+
+ Email integration is not available. Please contact your organization
+ administrator.
+
+ )
) : currentAlertChannel === "SLACK" ? (
{slack.status === "READY" ? (