feat(studio): set email rate limit to 30 when enabling custom SMTP (#40638)

This commit is contained in:
Cemal Kılıç authored and GitHub committed 2025-11-24 04:55:15 +00:00
1 parent d990ae840e
commit a3ec8adeaa
2 files changed
+9 -2

No files matched your search

@@ -149,7 +149,15 @@ export const SmtpForm = () => {
const onSubmit = (values: SmtpFormValues) => {
const { ENABLE_SMTP, ...rest } = values
const payload = ENABLE_SMTP ? rest : defaultDisabledSmtpFormValues
const basePayload = ENABLE_SMTP ? rest : defaultDisabledSmtpFormValues
// When enabling SMTP, set RATE_LIMIT_EMAIL_SENT to 30
// When disabling, backend will handle resetting to default
const isEnablingSmtp = ENABLE_SMTP && !isSmtpEnabled(authConfig)
const payload = {
...basePayload,
...(isEnablingSmtp && { RATE_LIMIT_EMAIL_SENT: 30 }),
}
// Format payload: Convert port to string
if (payload.SMTP_PORT) {
@@ -27,6 +27,5 @@ export const generateFormValues = (config?: Partial<AuthConfig>): Partial<AuthCo
SMTP_PASS: '',
SMTP_PORT: config?.SMTP_PORT ?? '465',
SMTP_MAX_FREQUENCY: config?.SMTP_MAX_FREQUENCY ?? 60,
RATE_LIMIT_EMAIL_SENT: config?.RATE_LIMIT_EMAIL_SENT ?? 30,
}
}