fix: smtp crash due to SMTP_SECURE (#246)

Co-authored-by: charles-gauthereau <charles.gauthereau@soluce-technologies.com>
This commit is contained in:
Charles GTE
2026-04-02 11:07:48 +02:00
committed by GitHub
co-authored by charles-gauthereau
parent e02c5496ae
commit 27e1da6363
6 changed files with 51 additions and 14 deletions
@@ -6,6 +6,7 @@ export const EmailFormSchema = z.object({
smtpHost: z.string(),
smtpPort: z.string(),
smtpUser: z.string(),
smtpSecure: z.boolean()
});
export type EmailFormType = z.infer<typeof EmailFormSchema>;
@@ -30,6 +30,7 @@ import {render} from "@react-email/components";
import EmailSettingsTest from "@/components/emails/email-settings-test";
import {ButtonWithLoading} from "@/components/wrappers/common/button/button-with-loading";
import {Send} from "lucide-react";
import {Switch} from "@/components/ui/switch";
export type EmailFormProps = {
defaultValues?: EmailFormType;
@@ -178,6 +179,23 @@ export const EmailForm = (props: EmailFormProps) => {
</FormItem>
)}
/>
<FormField
control={form.control}
name="smtpSecure"
render={({field}) => (
<FormItem>
<FormLabel>Secure</FormLabel>
<FormControl>
<Switch
checked={field.value}
onCheckedChange={field.onChange}
/>
</FormControl>
<FormMessage/>
</FormItem>
)}
/>
<div className="flex justify-between gap-4">
{props.defaultValues?.smtpFrom && (
<Tooltip>