From 3ce67bacad8d21327f07a4838da1441b2138959d Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Wed, 15 Apr 2026 12:16:33 -0700 Subject: [PATCH] [Feature] UI - Users: add Send Invitation Email toggle to Invite User modal The Invite User flow was calling /user/new without send_invite_email, so the backend invitation-email hook (gated on send_invite_email is True) was silently skipped. Add a checkbox, default on, so admins can opt out when needed. --- .../src/components/CreateUserButton.tsx | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/ui/litellm-dashboard/src/components/CreateUserButton.tsx b/ui/litellm-dashboard/src/components/CreateUserButton.tsx index b65caec26d0..7d2fc101508 100644 --- a/ui/litellm-dashboard/src/components/CreateUserButton.tsx +++ b/ui/litellm-dashboard/src/components/CreateUserButton.tsx @@ -2,7 +2,7 @@ import { InfoCircleOutlined, UserAddOutlined } from "@ant-design/icons"; import { useQueryClient } from "@tanstack/react-query"; import { useOrganizations } from "@/app/(dashboard)/hooks/organizations/useOrganizations"; import { Accordion, AccordionBody, AccordionHeader, SelectItem, TextInput } from "@tremor/react"; -import { Alert, Button, Form, Input, Modal, Select, Select as Select2, Space, Tooltip, Typography } from "antd"; +import { Alert, Button, Checkbox, Form, Input, Modal, Select, Select as Select2, Space, Tooltip, Typography } from "antd"; import React, { useEffect, useMemo, useState } from "react"; import BulkCreateUsers from "./bulk_create_users_button"; import TeamDropdown from "./common_components/team_dropdown"; @@ -113,6 +113,7 @@ export const CreateUserButton: React.FC = ({ user_role: string; organization_ids?: string[]; organizations?: string[]; + send_invite_email?: boolean; }) => { try { NotificationsManager.info("Making API Call"); @@ -181,7 +182,7 @@ export const CreateUserButton: React.FC = ({ labelCol={{ span: 8 }} wrapperCol={{ span: 16 }} labelAlign="left" - initialValues={{ user_role: "internal_user_viewer" }} + initialValues={{ user_role: "internal_user_viewer", send_invite_email: true }} > = ({ + + Send invitation email + +
@@ -270,7 +279,7 @@ export const CreateUserButton: React.FC = ({ labelCol={{ span: 8 }} wrapperCol={{ span: 16 }} labelAlign="left" - initialValues={{ user_role: "internal_user_viewer" }} + initialValues={{ user_role: "internal_user_viewer", send_invite_email: true }} > @@ -360,6 +369,15 @@ export const CreateUserButton: React.FC = ({ + + + Send invitation email + +