test-api / app.py
DhanushMahesh's picture
Add initial implementation of FastAPI application with email service
24755f7
raw
history blame contribute delete
559 Bytes
from fastapi import FastAPI
from service import EmailService
app = FastAPI()
@app.post("/check")
async def check_email_service(
):
try:
email_service = EmailService()
await email_service.send_test_email("dhanush@yuvabe.com")
return {
"status_code": 200,
"message": "Test email sent successfully.",
"data": None,
}
except Exception as e:
return {
"status_code": 500,
"message": f"Failed to send test email: {e}",
"data": None,
}