diff --git a/application/src/components/settings/general/MailSettingsTab.tsx b/application/src/components/settings/general/MailSettingsTab.tsx index 45f3ff7..1e02c95 100644 --- a/application/src/components/settings/general/MailSettingsTab.tsx +++ b/application/src/components/settings/general/MailSettingsTab.tsx @@ -1,5 +1,4 @@ - import React, { useState } from 'react'; import { Input } from "@/components/ui/input"; import { Switch } from "@/components/ui/switch"; @@ -27,18 +26,15 @@ const MailSettingsTab: React.FC = ({ setIsTestingEmail(true); console.log('Testing email with data:', data); - const response = await fetch('/api/settings', { + const response = await fetch('/api/settings/test/email', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ - action: 'sendTestEmail', - data: { - email: data.email, - template: data.template, - ...(data.collection && { collection: data.collection }) - } + email: data.email, + template: data.template, + ...(data.collection && { collection: data.collection }) }) }); @@ -257,10 +253,16 @@ const MailSettingsTab: React.FC = ({ )} /> - - {/* Only show Test Email button, removed Test Connection button */} - {isEditing && form.watch('smtp.enabled') && ( -
+
+ + {/* Test Email button - outside the form area and always visible when SMTP is enabled */} + {form.watch('smtp.enabled') && ( +
+
+
+

{t("testEmailSettings", "settings")}

+

{t("testEmailDescription", "settings")}

+
- )} -
+ + )} = ({ ); }; -export default MailSettingsTab; +export default MailSettingsTab; \ No newline at end of file