import * as templates from "./templates"; async function renderEmail( template: K, props: React.ComponentProps<(typeof templates)[K]> ) { const Component = templates[template]; const ReactDOMServer = (await import("react-dom/server")).default; return ( // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-expect-error ReactDOMServer.renderToStaticMarkup(Component(props)) // Remove `` injected scripts .replace(/