* add first concept * completed configuration ui update * add button for testing email configuration * improve mobile layout * add migration * run formatter * delete unnecessary modal * remove unused comment
28 lines
709 B
TypeScript
28 lines
709 B
TypeScript
import { Button } from "@mantine/core";
|
|
import useUser from "../../../hooks/user.hook";
|
|
import configService from "../../../services/config.service";
|
|
import toast from "../../../utils/toast.util";
|
|
|
|
const TestEmailButton = () => {
|
|
const { user } = useUser();
|
|
|
|
return (
|
|
<Button
|
|
variant="light"
|
|
onClick={() =>
|
|
configService
|
|
.sendTestEmail(user!.email)
|
|
.then(() => toast.success("Email sent successfully"))
|
|
.catch(() =>
|
|
toast.error(
|
|
"Failed to send the email. Please check the backend logs for more information."
|
|
)
|
|
)
|
|
}
|
|
>
|
|
Send test email
|
|
</Button>
|
|
);
|
|
};
|
|
export default TestEmailButton;
|