import { jsx as _jsx } from "react/jsx-runtime";
import { render, toPlainText } from '@react-email/components';
/**
 * Renders an email component to HTML and plain text.
 *
 * @param Component - The email component to render (must be created with defineEmail).
 * @param props - The props to pass to the email component.
 * @returns The rendered HTML, plain text, and subject line.
 */
export async function renderEmail(Component, props) {
    const html = await render(_jsx(Component, { ...props }));
    const text = toPlainText(html);
    const subject = typeof Component.subject === 'function'
        ? Component.subject(props)
        : Component.subject;
    return {
        html,
        text,
        subject,
    };
}
//# sourceMappingURL=render-email.service.js.map