mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fix - make email alerting free
This commit is contained in:
parent
9c8af6676c
commit
7d5fe910f2
1 changed files with 2 additions and 9 deletions
|
@ -1850,20 +1850,13 @@ async def send_email(receiver_email, subject, html):
|
|||
from litellm.proxy.proxy_server import premium_user
|
||||
from litellm.proxy.proxy_server import CommonProxyErrors
|
||||
|
||||
# Check if user is premium - This is an Enterprise only Feature
|
||||
if premium_user != True:
|
||||
raise Exception(
|
||||
f"Trying to use Email Alerting\n {CommonProxyErrors.not_premium_user.value}"
|
||||
)
|
||||
# Done Checking
|
||||
|
||||
smtp_host = os.getenv("SMTP_HOST")
|
||||
smtp_port = os.getenv("SMTP_PORT", 587) # default to port 587
|
||||
smtp_port = int(os.getenv("SMTP_PORT", "587")) # default to port 587
|
||||
smtp_username = os.getenv("SMTP_USERNAME")
|
||||
smtp_password = os.getenv("SMTP_PASSWORD")
|
||||
sender_email = os.getenv("SMTP_SENDER_EMAIL", None)
|
||||
if sender_email is None:
|
||||
raise Exception("Trying to use SMTP, but SMTP_SENDER_EMAIL is not set")
|
||||
raise ValueError("Trying to use SMTP, but SMTP_SENDER_EMAIL is not set")
|
||||
|
||||
## EMAIL SETUP ##
|
||||
email_message = MIMEMultipart()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue