Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
import { validateContactEmail } from "@webstudio-is/project-build/contracts";
import {
getProjectPlanFeatures,
type AppContext,
} from "@webstudio-is/trpc-interface/index.server";
export const validateProjectSettingsContactEmail = async ({
projectId,
currentContactEmail,
nextContactEmail,
context,
}: {
projectId: string;
currentContactEmail: unknown;
nextContactEmail: unknown;
context: AppContext;
}) => {
if (
typeof nextContactEmail !== "string" ||
nextContactEmail === currentContactEmail
) {
return;
}
const ownerPlan = await getProjectPlanFeatures(projectId, context);
return validateContactEmail(
nextContactEmail,
ownerPlan.maxContactEmailsPerProject
);
};