We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5a2900c commit 37982d1Copy full SHA for 37982d1
1 file changed
38-Email-sender-script/app.py
@@ -0,0 +1,15 @@
1
+from fastapi import FastAPI
2
+from pydantic import BaseModel, EmailStr
3
+from email_sender import send_bulk_emails
4
+import threading
5
+
6
+app = FastAPI(title="Bulk Email Sender API")
7
8
+class BulkEmailRequest(BaseModel):
9
+ csv_file: str
10
11
+@app.post("/send_bulk")
12
+def send_bulk(request: BulkEmailRequest):
13
+ # Run in background to avoid blocking
14
+ threading.Thread(target=send_bulk_emails, args=(request.csv_file,)).start()
15
+ return {"status": "Emails are being sent in background"}
0 commit comments