| @@ -17,7 +17,7 @@ import { | |||||
| import { Tab, Tabs, TabsProps, Typography } from "@mui/material"; | import { Tab, Tabs, TabsProps, Typography } from "@mui/material"; | ||||
| import TimesheetMailDetails from "./TimesheetMailDetails"; | import TimesheetMailDetails from "./TimesheetMailDetails"; | ||||
| import { Error } from "@mui/icons-material"; | import { Error } from "@mui/icons-material"; | ||||
| import { MailSave, saveMail, testMail } from "@/app/api/mail/actions"; | |||||
| import { MailSave, saveMail, testEveryone, test7th, test15th } from "@/app/api/mail/actions"; | |||||
| import SettingDetails from "./SettingDetails"; | import SettingDetails from "./SettingDetails"; | ||||
| import { errorDialog, submitDialog, successDialog } from "../Swal/CustomAlerts"; | import { errorDialog, submitDialog, successDialog } from "../Swal/CustomAlerts"; | ||||
| @@ -91,7 +91,18 @@ const MailSetting: React.FC<Props> = ({ | |||||
| console.log(response) | console.log(response) | ||||
| if (response !== null) { | if (response !== null) { | ||||
| if (test) { | if (test) { | ||||
| await testMail() | |||||
| let msg = "" | |||||
| try { | |||||
| msg = "testEveryone" | |||||
| await testEveryone() | |||||
| msg = "test7th" | |||||
| await test7th() | |||||
| msg = "test15th" | |||||
| await test15th() | |||||
| } catch (error) { | |||||
| console.log(error) | |||||
| console.log(msg) | |||||
| } | |||||
| } | } | ||||
| successDialog(t("Save Success"), t) | successDialog(t("Save Success"), t) | ||||
| @@ -169,7 +180,7 @@ const MailSetting: React.FC<Props> = ({ | |||||
| {t("Cancel")} | {t("Cancel")} | ||||
| </Button> | </Button> | ||||
| <Button variant="contained" startIcon={<Check />} onClick={() => setTest(true)} type="submit"> | <Button variant="contained" startIcon={<Check />} onClick={() => setTest(true)} type="submit"> | ||||
| {t("Save And Test")} | |||||
| {t("send to everyone")} | |||||
| </Button> | </Button> | ||||
| <Button variant="contained" startIcon={<Check />} onClick={() => setTest(false)} type="submit"> | <Button variant="contained" startIcon={<Check />} onClick={() => setTest(false)} type="submit"> | ||||
| {t("Save")} | {t("Save")} | ||||