A free and open-source block-based email template builder.
TypeScript amazonsesdeveloper-toolsemailemail-editoremail-marketingemail-templateemail-template-builderemailapiemailjshtml-email-editorno-codenocode-email-editoropen-source-email-buildersendgridtransactional-emailswysiwyg-email-editorwysiwyg-html-editor
import { z } from 'zod';
export type BaseZodDictionary = { [name: string]: z.AnyZodObject };
export type DocumentBlocksDictionary<T extends BaseZodDictionary> = {
[K in keyof T]: {
schema: T[K];
Component: (props: z.infer<T[K]>) => JSX.Element;
};
};
export type BlockConfiguration<T extends BaseZodDictionary> = {
[TType in keyof T]: {
type: TType;
data: z.infer<T[TType]>;
};
}[keyof T];
export class BlockNotFoundError extends Error {
blockId: string;
constructor(blockId: string) {
super('Could not find a block with the given blockId');
this.blockId = blockId;
}
}