From 106342927578f4e844d5fc468d0093448d31c893 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Tue, 20 Sep 2022 21:24:56 +0200 Subject: [PATCH] :bug: (limits) Fix usage limits email emojis --- apps/viewer/assets/emails/almostReachedChatsLimitEmail.ts | 2 +- apps/viewer/assets/emails/almostReachedStorageLimitEmail.ts | 2 +- apps/viewer/assets/emails/reachedChatsLimitEmail.ts | 2 +- apps/viewer/assets/emails/reachedStorageLimitEmail.ts | 2 +- apps/viewer/pages/api/typebots/[typebotId]/results.ts | 4 ++-- packages/utils/api/sendEmailNotification.ts | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/viewer/assets/emails/almostReachedChatsLimitEmail.ts b/apps/viewer/assets/emails/almostReachedChatsLimitEmail.ts index f8de63267..33cc7398a 100644 --- a/apps/viewer/assets/emails/almostReachedChatsLimitEmail.ts +++ b/apps/viewer/assets/emails/almostReachedChatsLimitEmail.ts @@ -30,4 +30,4 @@ p { display:block;margin:13px 0; }
header image
Your bots are chatting a lot. That's amazing. ❤️
This means you've almost reached your monthly chats limit. You currently reached 80% of ${readableChatsLimit}.
This limit will be reset on ${readableResetDate}.
Your bots won't start the chat if you reach the limit before this date. ⚠️
If you need more monthly responses, you will need to upgrade your plan.
` +}
header image
Your bots are chatting a lot. That's amazing. 💙
This means you've almost reached your monthly chats limit. You currently reached 80% of ${readableChatsLimit}.
This limit will be reset on ${readableResetDate}.
Your bots won't start the chat if you reach the limit before this date. ⚠️
If you need more monthly responses, you will need to upgrade your plan.
` diff --git a/apps/viewer/assets/emails/almostReachedStorageLimitEmail.ts b/apps/viewer/assets/emails/almostReachedStorageLimitEmail.ts index c3ea6ced1..f36e3f0bc 100644 --- a/apps/viewer/assets/emails/almostReachedStorageLimitEmail.ts +++ b/apps/viewer/assets/emails/almostReachedStorageLimitEmail.ts @@ -28,4 +28,4 @@ p { display:block;margin:13px 0; }
header image
Your bots are working a lot. That's amazing. ü§ñ
This means you've almost reached your storage limit. You currently reached 80% of your ${readableStorageLimit} limit.
Your bots won't collect new files once you reach the limit. ⚠️
To make sure it won't happen, you need to upgrade your plan or delete existing results to free up space.
` +}
header image
Your bots are working a lot. That's amazing. 🤖
This means you've almost reached your storage limit. You currently reached 80% of your ${readableStorageLimit} limit.
Your bots won't collect new files once you reach the limit. ⚠️
To make sure it won't happen, you need to upgrade your plan or delete existing results to free up space.
` diff --git a/apps/viewer/assets/emails/reachedChatsLimitEmail.ts b/apps/viewer/assets/emails/reachedChatsLimitEmail.ts index 67049263f..93a458378 100644 --- a/apps/viewer/assets/emails/reachedChatsLimitEmail.ts +++ b/apps/viewer/assets/emails/reachedChatsLimitEmail.ts @@ -30,4 +30,4 @@ p { display:block;margin:13px 0; }
header image
It just happened, you've reached your monthly ${readableChatsLimit} chats limit üòÆ
It means your bots are closed until ${readableResetDate}.
If you'd like to continue chatting with your users this month, then you need to upgrade your plan. üöÄ
` +}
header image
It just happened, you've reached your monthly ${readableChatsLimit} chats limit 😮
It means your bots are closed until ${readableResetDate}.
If you'd like to continue chatting with your users this month, then you need to upgrade your plan. 🚀
` diff --git a/apps/viewer/assets/emails/reachedStorageLimitEmail.ts b/apps/viewer/assets/emails/reachedStorageLimitEmail.ts index 9b057b2e0..5abdf2dff 100644 --- a/apps/viewer/assets/emails/reachedStorageLimitEmail.ts +++ b/apps/viewer/assets/emails/reachedStorageLimitEmail.ts @@ -28,4 +28,4 @@ p { display:block;margin:13px 0; }
header image
It just happened, you've reached your ${readableStorageLimit} storage limit üòÆ
It means your bots won't collect new files from your users.
If you'd like to continue collecting files, then you need to upgrade your plan or remove existing results to free up space. üöÄ
` +}
header image
It just happened, you've reached your ${readableStorageLimit} storage limit 😮
It means your bots won't collect new files from your users.
If you'd like to continue collecting files, then you need to upgrade your plan or remove existing results to free up space. 🚀
` diff --git a/apps/viewer/pages/api/typebots/[typebotId]/results.ts b/apps/viewer/pages/api/typebots/[typebotId]/results.ts index 8ec0501f1..bf9568135 100644 --- a/apps/viewer/pages/api/typebots/[typebotId]/results.ts +++ b/apps/viewer/pages/api/typebots/[typebotId]/results.ts @@ -135,7 +135,7 @@ const sendAlmostReachChatsLimitEmail = async ({ await sendEmailNotification({ to: members.map((member) => member.user.email).filter(isDefined), - subject: "You've been invited to collaborate 🤝", + subject: "You're close to your chats limit", html: almostReachedChatsLimitEmail({ readableChatsLimit, readableResetDate, @@ -169,7 +169,7 @@ const sendReachedAlertEmail = async ({ .join(' ') await sendEmailNotification({ to: members.map((member) => member.user.email).filter(isDefined), - subject: "You've been invited to collaborate 🤝", + subject: "You've hit your monthly chats limit", html: reachedSChatsLimitEmail({ readableChatsLimit, readableResetDate, diff --git a/packages/utils/api/sendEmailNotification.ts b/packages/utils/api/sendEmailNotification.ts index 71a2fe209..94ae39a15 100644 --- a/packages/utils/api/sendEmailNotification.ts +++ b/packages/utils/api/sendEmailNotification.ts @@ -12,7 +12,7 @@ export const sendEmailNotification = (props: Omit) => { }) return transporter.sendMail({ - from: env('SMTP_FROM'), + from: process.env.SMTP_FROM ?? env('SMTP_FROM'), ...props, }) }