"Send Testmail" button (not translated) #3050

This commit is contained in:
MichaelDvP
2026-05-03 14:24:03 +02:00
parent 87a3ca8393
commit 2579450eae
2 changed files with 32 additions and 4 deletions

View File

@@ -165,6 +165,21 @@ const ApplicationSettings = () => {
await doRestart();
};
const sendmail = async () => {
await sendAPI({
device: 'system',
cmd: 'sendmail',
data: 'testmail',
id: 0
})
.then(() => {
toast.success(LL.SUCCESSFUL());
})
.catch((error: Error) => {
toast.error(error.message);
});
};
const boardProfileItems = boardProfileSelectItems();
const content = () => {
@@ -362,8 +377,7 @@ const ApplicationSettings = () => {
container
spacing={2}
direction="row"
justifyContent="flex-start"
alignItems="flex-start"
sx={{ justifyContent: 'flex-start', alignItems: 'flex-start' }}
>
<Grid>
<ValidatedTextField
@@ -389,7 +403,10 @@ const ApplicationSettings = () => {
margin="normal"
/>
</Grid>
<Grid size={4} mt={!data.email_ssl && !data.email_starttls ? 0 : 3}>
<Grid
size={4}
sx={{ mt: !data.email_ssl && !data.email_starttls ? 0 : 3 }}
>
{!data.email_starttls && (
<BlockFormControlLabel
sx={{ width: '12ch' }}
@@ -482,6 +499,17 @@ const ApplicationSettings = () => {
margin="normal"
/>
</Grid>
<Grid>
<Button
sx={{ mt: 3 }}
variant="outlined"
color="primary"
disabled={dirtyFlags.length !== 0}
onClick={sendmail}
>
Send Testmail
</Button>
</Grid>
</Grid>
</>
)}