import { render } from '@faire/mjml-react/utils/render' import fs from 'fs' import path from 'path' import { AlmostReachedChatsLimitEmail, AlmostReachedStorageLimitEmail, DefaultBotNotificationEmail, GuestInvitationEmail, ReachedChatsLimitEmail, ReachedStorageLimitEmail, WorkspaceMemberInvitation, } from './emails' import { MagicLinkEmail } from './emails/MagicLinkEmail' const createDistFolder = () => { const dist = path.resolve(__dirname, 'dist') if (!fs.existsSync(dist)) { fs.mkdirSync(dist) } } const createHtmlFile = () => { fs.writeFileSync( path.resolve(__dirname, 'dist', 'guestInvitation.html'), render( ).html ) fs.writeFileSync( path.resolve(__dirname, 'dist', 'workspaceMemberInvitation.html'), render( ).html ) fs.writeFileSync( path.resolve(__dirname, 'dist', 'almostReachedChatsLimit.html'), render( ).html ) fs.writeFileSync( path.resolve(__dirname, 'dist', 'almostReachedStorageLimit.html'), render( ).html ) fs.writeFileSync( path.resolve(__dirname, 'dist', 'reachedChatsLimit.html'), render( ).html ) fs.writeFileSync( path.resolve(__dirname, 'dist', 'reachedStorageLimit.html'), render( ).html ) fs.writeFileSync( path.resolve(__dirname, 'dist', 'defaultBotNotification.html'), render( ).html ) fs.writeFileSync( path.resolve(__dirname, 'dist', 'magicLink.html'), render().html ) } createDistFolder() createHtmlFile()