From 66feb7f8841920e3a8bdf79564c090033bbc06d2 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Mon, 27 May 2024 23:21:16 -0700 Subject: [PATCH] feat -working email settins --- .../src/components/settings.tsx | 131 +++++++++++++++--- 1 file changed, 112 insertions(+), 19 deletions(-) diff --git a/ui/litellm-dashboard/src/components/settings.tsx b/ui/litellm-dashboard/src/components/settings.tsx index badea63416..b1c6587bdb 100644 --- a/ui/litellm-dashboard/src/components/settings.tsx +++ b/ui/litellm-dashboard/src/components/settings.tsx @@ -571,26 +571,119 @@ const Settings: React.FC = ({ - A key is created for a specific user_id
- A key belonging to a user crosses its budget */} - Setup -
- {alerts - .filter((alert) => alert.name == "email") - .map((alert, index) => ( - -
    - {Object.entries(alert.variables ?? {}) - - .map(([key, value]) => ( -
  • - {key} - -
  • - ))} -
-
- ))} +Email Settings +
+ {alerts + .filter((alert) => alert.name === "email") + .map((alert, index) => ( + -
+
    + + {Object.entries(alert.variables ?? {}).map(([key, value]) => ( +
  • + + { premiumUser!= true && (key === "EMAIL_LOGO_URL" || key === "EMAIL_SUPPORT_CONTACT") ? ( + + + ) : ( +
    + {key} + +
    + + )} + + {/* Added descriptions for input fields */} +

    + {key === "SMTP_HOST" && ( +

    + Enter the SMTP host address, e.g. 'smtp.resend.com' + Required * +
    + + )} + + {key === "SMTP_PORT" && ( +
    + Enter the SMTP port number, e.g. '587' + Required * + +
    + + )} + + {key === "SMTP_USERNAME" && ( +
    + Enter the SMTP username, e.g. 'username' + Required * +
    + + )} + + {key === "SMTP_PASSWORD" && ( + Required * + )} + + {key === "SMTP_SENDER_EMAIL" && ( +
    + Enter the sender email address, e.g. 'sender@berri.ai' + Required * + +
    + )} + + {key === "TEST_EMAIL_ADDRESS" && ( +
    + Email Address to send 'Test Email Alert' to. example: 'info@berri.ai' + Required * +
    + ) + } + {key === "EMAIL_LOGO_URL" && ( +
    + (Optional) Customize the Logo that appears in the email, pass a url to your logo +
    + ) + } + {key === "EMAIL_SUPPORT_CONTACT" && ( +
    + (Optional) Customize the support email address that appears in the email. Default is support@berri.ai +
    + ) + } +

    +
  • + ))} +
    +
+ + ))} +