Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

[Feature] UI - Users: add Send Invitation Email toggle to Invite User modal

Yuneng Jiang3ce67bacad8d
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<CreateuserProps> = ({
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<CreateuserProps> = ({
labelCol={{ span: 8 }}
wrapperCol={{ span: 16 }}
labelAlign="left"
- initialValues={{ user_role: "internal_user_viewer" }}
+ initialValues={{ user_role: "internal_user_viewer", send_invite_email: true }}
>
<Alert
message="Email invitations"
@@ -224,6 +225,14 @@ export const CreateUserButton: React.FC<CreateuserProps> = ({
<Input.TextArea rows={4} placeholder="Enter metadata as JSON" />
</Form.Item>
+ <Form.Item
+ name="send_invite_email"
+ valuePropName="checked"
+ wrapperCol={{ offset: 8, span: 16 }}
+ >
+ <Checkbox>Send invitation email</Checkbox>
+ </Form.Item>
+
<div style={{ textAlign: "right", marginTop: "10px" }}>
<Button htmlType="submit">Create User</Button>
</div>
@@ -270,7 +279,7 @@ export const CreateUserButton: React.FC<CreateuserProps> = ({
labelCol={{ span: 8 }}
wrapperCol={{ span: 16 }}
labelAlign="left"
- initialValues={{ user_role: "internal_user_viewer" }}
+ initialValues={{ user_role: "internal_user_viewer", send_invite_email: true }}
>
<Form.Item label="User Email" name="user_email">
<Input />
@@ -360,6 +369,15 @@ export const CreateUserButton: React.FC<CreateuserProps> = ({
</Form.Item>
</AccordionBody>
</Accordion>
+
+ <Form.Item
+ name="send_invite_email"
+ valuePropName="checked"
+ wrapperCol={{ offset: 8, span: 16 }}
+ >
+ <Checkbox>Send invitation email</Checkbox>
+ </Form.Item>
+
<div style={{ textAlign: "right", marginTop: "10px" }}>
<Button type="primary" icon={<UserAddOutlined />} htmlType="submit">
Invite User