🛂 Reset isQuarantined on the first of month
This commit is contained in:
@ -13,6 +13,7 @@ import { SendMailOptions } from 'nodemailer'
|
||||
import { sendEmail } from '../sendEmail'
|
||||
|
||||
type AlmostReachedChatsLimitEmailProps = {
|
||||
usagePercent: number
|
||||
chatsLimit: number
|
||||
url: string
|
||||
}
|
||||
@ -26,6 +27,7 @@ const readableResetDate = firstDayOfNextMonth
|
||||
.join(' ')
|
||||
|
||||
export const AlmostReachedChatsLimitEmail = ({
|
||||
usagePercent,
|
||||
chatsLimit,
|
||||
url,
|
||||
}: AlmostReachedChatsLimitEmailProps) => {
|
||||
@ -45,7 +47,8 @@ export const AlmostReachedChatsLimitEmail = ({
|
||||
<Text>Your bots are chatting a lot. That's amazing. 💙</Text>
|
||||
<Text>
|
||||
This means you've almost reached your monthly chats limit.
|
||||
You currently reached 80% of {readableChatsLimit} chats.
|
||||
You currently reached {usagePercent}% of {readableChatsLimit}{' '}
|
||||
chats.
|
||||
</Text>
|
||||
<Text>This limit will be reset on {readableResetDate}.</Text>
|
||||
<Text fontWeight="800">
|
||||
|
@ -1,65 +0,0 @@
|
||||
import React, { ComponentProps } from 'react'
|
||||
import {
|
||||
Mjml,
|
||||
MjmlBody,
|
||||
MjmlSection,
|
||||
MjmlColumn,
|
||||
MjmlSpacer,
|
||||
} from '@faire/mjml-react'
|
||||
import { render } from '@faire/mjml-react/utils/render'
|
||||
import { Button, Head, HeroImage, Text } from '../components'
|
||||
import { SendMailOptions } from 'nodemailer'
|
||||
import { sendEmail } from '../sendEmail'
|
||||
|
||||
type AlmostReachedStorageLimitEmailProps = {
|
||||
storageLimit: number
|
||||
url: string
|
||||
}
|
||||
|
||||
export const AlmostReachedStorageLimitEmail = ({
|
||||
storageLimit,
|
||||
url,
|
||||
}: AlmostReachedStorageLimitEmailProps) => {
|
||||
const readableStorageLimit = `${storageLimit} GB`
|
||||
|
||||
return (
|
||||
<Mjml>
|
||||
<Head />
|
||||
<MjmlBody width={600}>
|
||||
<MjmlSection padding="0">
|
||||
<MjmlColumn>
|
||||
<HeroImage src="https://typebot.s3.fr-par.scw.cloud/public/assets/yourBotIsFlyingEmailBanner.png" />
|
||||
</MjmlColumn>
|
||||
</MjmlSection>
|
||||
<MjmlSection padding="0 24px" cssClass="smooth">
|
||||
<MjmlColumn>
|
||||
<Text>Your bots are working a lot. That's amazing. 🤖</Text>
|
||||
<Text>
|
||||
This means you've almost reached your storage limit. You
|
||||
currently reached 80% of your {readableStorageLimit} storage
|
||||
limit.
|
||||
</Text>
|
||||
<Text fontWeight="800">
|
||||
Upon this limit your bots will still continue to collect new
|
||||
files, but we ask you kindly to upgrade your storage limit or
|
||||
delete existing results to free up space.
|
||||
</Text>
|
||||
<MjmlSpacer height="24px" />
|
||||
<Button link={url}>Upgrade workspace</Button>
|
||||
</MjmlColumn>
|
||||
</MjmlSection>
|
||||
</MjmlBody>
|
||||
</Mjml>
|
||||
)
|
||||
}
|
||||
|
||||
export const sendAlmostReachedStorageLimitEmail = ({
|
||||
to,
|
||||
...props
|
||||
}: Pick<SendMailOptions, 'to'> &
|
||||
ComponentProps<typeof AlmostReachedStorageLimitEmail>) =>
|
||||
sendEmail({
|
||||
to,
|
||||
subject: "You're close to your storage limit",
|
||||
html: render(<AlmostReachedStorageLimitEmail {...props} />).html,
|
||||
})
|
@ -1,64 +0,0 @@
|
||||
import { ComponentProps } from 'react'
|
||||
import {
|
||||
Mjml,
|
||||
MjmlBody,
|
||||
MjmlSection,
|
||||
MjmlColumn,
|
||||
MjmlSpacer,
|
||||
} from '@faire/mjml-react'
|
||||
import { render } from '@faire/mjml-react/utils/render'
|
||||
import { Button, Head, HeroImage, Text } from '../components'
|
||||
import { parseNumberWithCommas } from '@typebot.io/lib'
|
||||
import { SendMailOptions } from 'nodemailer'
|
||||
import { sendEmail } from '../sendEmail'
|
||||
|
||||
type ReachedChatsLimitEmailProps = {
|
||||
chatsLimit: number
|
||||
url: string
|
||||
}
|
||||
|
||||
export const ReachedChatsLimitEmail = ({
|
||||
chatsLimit,
|
||||
url,
|
||||
}: ReachedChatsLimitEmailProps) => {
|
||||
const readableChatsLimit = parseNumberWithCommas(chatsLimit)
|
||||
|
||||
return (
|
||||
<Mjml>
|
||||
<Head />
|
||||
<MjmlBody width={600}>
|
||||
<MjmlSection padding="0">
|
||||
<MjmlColumn>
|
||||
<HeroImage src="https://typebot.s3.fr-par.scw.cloud/public/assets/actionRequiredEmailBanner.png" />
|
||||
</MjmlColumn>
|
||||
</MjmlSection>
|
||||
<MjmlSection padding="0 24px" cssClass="smooth">
|
||||
<MjmlColumn>
|
||||
<Text>
|
||||
It just happened, you've reached your monthly{' '}
|
||||
{readableChatsLimit} chats limit 😮
|
||||
</Text>
|
||||
<Text>
|
||||
If you'd like your bots to continue chatting with your users
|
||||
this month, then you need to upgrade your plan. 🚀
|
||||
</Text>
|
||||
|
||||
<MjmlSpacer height="24px" />
|
||||
<Button link={url}>Upgrade workspace</Button>
|
||||
</MjmlColumn>
|
||||
</MjmlSection>
|
||||
</MjmlBody>
|
||||
</Mjml>
|
||||
)
|
||||
}
|
||||
|
||||
export const sendReachedChatsLimitEmail = ({
|
||||
to,
|
||||
...props
|
||||
}: Pick<SendMailOptions, 'to'> &
|
||||
ComponentProps<typeof ReachedChatsLimitEmail>) =>
|
||||
sendEmail({
|
||||
to,
|
||||
subject: "You've reached your chats limit",
|
||||
html: render(<ReachedChatsLimitEmail {...props} />).html,
|
||||
})
|
@ -1,63 +0,0 @@
|
||||
import React, { ComponentProps } from 'react'
|
||||
import {
|
||||
Mjml,
|
||||
MjmlBody,
|
||||
MjmlSection,
|
||||
MjmlColumn,
|
||||
MjmlSpacer,
|
||||
} from '@faire/mjml-react'
|
||||
import { render } from '@faire/mjml-react/utils/render'
|
||||
import { Button, Head, HeroImage, Text } from '../components'
|
||||
import { SendMailOptions } from 'nodemailer'
|
||||
import { sendEmail } from '../sendEmail'
|
||||
|
||||
type ReachedStorageLimitEmailProps = {
|
||||
storageLimit: number
|
||||
url: string
|
||||
}
|
||||
|
||||
export const ReachedStorageLimitEmail = ({
|
||||
storageLimit,
|
||||
url,
|
||||
}: ReachedStorageLimitEmailProps) => {
|
||||
const readableStorageLimit = `${storageLimit} GB`
|
||||
|
||||
return (
|
||||
<Mjml>
|
||||
<Head />
|
||||
<MjmlBody width={600}>
|
||||
<MjmlSection padding="0">
|
||||
<MjmlColumn>
|
||||
<HeroImage src="https://typebot.s3.fr-par.scw.cloud/public/assets/actionRequiredEmailBanner.png" />
|
||||
</MjmlColumn>
|
||||
</MjmlSection>
|
||||
<MjmlSection padding="0 24px" cssClass="smooth">
|
||||
<MjmlColumn>
|
||||
<Text>
|
||||
It just happened, you've reached your {readableStorageLimit}{' '}
|
||||
storage limit 😮
|
||||
</Text>
|
||||
<Text>
|
||||
If you'd like to continue collecting files, then you need to
|
||||
upgrade your plan or remove existing results to free up space. 🚀
|
||||
</Text>
|
||||
|
||||
<MjmlSpacer height="24px" />
|
||||
<Button link={url}>Upgrade workspace</Button>
|
||||
</MjmlColumn>
|
||||
</MjmlSection>
|
||||
</MjmlBody>
|
||||
</Mjml>
|
||||
)
|
||||
}
|
||||
|
||||
export const sendReachedStorageLimitEmail = ({
|
||||
to,
|
||||
...props
|
||||
}: Pick<SendMailOptions, 'to'> &
|
||||
ComponentProps<typeof ReachedStorageLimitEmail>) =>
|
||||
sendEmail({
|
||||
to,
|
||||
subject: "You've reached your storage limit",
|
||||
html: render(<ReachedStorageLimitEmail {...props} />).html,
|
||||
})
|
@ -1,8 +1,5 @@
|
||||
export * from './AlmostReachedChatsLimitEmail'
|
||||
export * from './AlmostReachedStorageLimitEmail'
|
||||
export * from './DefaultBotNotificationEmail'
|
||||
export * from './GuestInvitationEmail'
|
||||
export * from './ReachedChatsLimitEmail'
|
||||
export * from './ReachedStorageLimitEmail'
|
||||
export * from './WorkspaceMemberInvitationEmail'
|
||||
export * from './MagicLinkEmail'
|
||||
|
@ -3,11 +3,8 @@ import fs from 'fs'
|
||||
import path from 'path'
|
||||
import {
|
||||
AlmostReachedChatsLimitEmail,
|
||||
AlmostReachedStorageLimitEmail,
|
||||
DefaultBotNotificationEmail,
|
||||
GuestInvitationEmail,
|
||||
ReachedChatsLimitEmail,
|
||||
ReachedStorageLimitEmail,
|
||||
WorkspaceMemberInvitation,
|
||||
} from './emails'
|
||||
import { MagicLinkEmail } from './emails/MagicLinkEmail'
|
||||
@ -47,38 +44,12 @@ const createHtmlFile = () => {
|
||||
path.resolve(__dirname, 'dist', 'almostReachedChatsLimit.html'),
|
||||
render(
|
||||
<AlmostReachedChatsLimitEmail
|
||||
usagePercent={86}
|
||||
url={'https://app.typebot.io'}
|
||||
chatsLimit={2000}
|
||||
/>
|
||||
).html
|
||||
)
|
||||
fs.writeFileSync(
|
||||
path.resolve(__dirname, 'dist', 'almostReachedStorageLimit.html'),
|
||||
render(
|
||||
<AlmostReachedStorageLimitEmail
|
||||
url={'https://app.typebot.io'}
|
||||
storageLimit={4}
|
||||
/>
|
||||
).html
|
||||
)
|
||||
fs.writeFileSync(
|
||||
path.resolve(__dirname, 'dist', 'reachedChatsLimit.html'),
|
||||
render(
|
||||
<ReachedChatsLimitEmail
|
||||
url={'https://app.typebot.io'}
|
||||
chatsLimit={10000}
|
||||
/>
|
||||
).html
|
||||
)
|
||||
fs.writeFileSync(
|
||||
path.resolve(__dirname, 'dist', 'reachedStorageLimit.html'),
|
||||
render(
|
||||
<ReachedStorageLimitEmail
|
||||
url={'https://app.typebot.io'}
|
||||
storageLimit={8}
|
||||
/>
|
||||
).html
|
||||
)
|
||||
fs.writeFileSync(
|
||||
path.resolve(__dirname, 'dist', 'defaultBotNotification.html'),
|
||||
render(
|
||||
|
Reference in New Issue
Block a user