This commit is contained in:
Iliyan Angelov
2025-11-21 08:55:55 +02:00
parent 6f85b8cf17
commit 4488e3a795
76 changed files with 364 additions and 36 deletions

View File

@@ -295,7 +295,7 @@ async def create_service_stripe_payment_intent(
intent = StripeService.create_payment_intent(
amount=amount,
currency=currency,
description=f"Service Booking
description=f"Service Booking #{booking.id}",
db=db
)

View File

@@ -712,11 +712,77 @@ async def test_smtp_email(
timestamp_str = datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S UTC")
test_html = f
test_html = f"""
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SMTP Test Email</title>
</head>
<body style="margin: 0; padding: 0; font-family: Arial, sans-serif; background-color: #f3f4f6;">
<table role="presentation" style="width: 100%; border-collapse: collapse;">
<tr>
<td style="padding: 40px 20px;">
<table role="presentation" style="max-width: 600px; margin: 0 auto; background-color: #ffffff; border-radius: 10px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);">
<tr>
<td style="padding: 40px; text-align: center; background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%); border-radius: 10px 10px 0 0;">
<h1 style="color: #d4af37; margin: 0; font-size: 28px;">SMTP Configuration Test</h1>
</td>
</tr>
<tr>
<td style="padding: 40px;">
<h2 style="color: #1a1a1a; font-size: 24px; margin-bottom: 20px;">✅ Success!</h2>
<p style="font-size: 16px; color: #374151; line-height: 1.6; margin-bottom: 20px;">
Hello {admin_name},
</p>
<p style="font-size: 16px; color: #374151; line-height: 1.6; margin-bottom: 20px;">
This is a test email to verify that your SMTP configuration is working correctly.
</p>
<div style="background: #d1fae5; border-left: 4px solid #10b981; padding: 15px; margin: 20px 0; border-radius: 4px;">
<p style="margin: 0; color: #065f46; font-size: 14px;">
<strong>Test Details:</strong><br>
Sent by: {admin_name}<br>
Timestamp: {timestamp_str}<br>
Status: SMTP Configuration Active
</p>
</div>
<p style="font-size: 16px; color: #374151; line-height: 1.6; margin-top: 30px;">
If you received this email, your SMTP settings are configured correctly and emails will be sent successfully.
</p>
</td>
</tr>
<tr>
<td style="padding: 40px; background-color: #f9fafb; border-radius: 0 0 10px 10px; text-align: center;">
<p style="color: #6b7280; font-size: 12px; margin: 0;">Hotel Booking System - SMTP Test</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
"""
test_text = f
.strip()
test_text = f"""
SMTP Configuration Test
Hello {admin_name},
This is a test email to verify that your SMTP configuration is working correctly.
Test Details:
- Sent by: {admin_name}
- Timestamp: {timestamp_str}
- Status: SMTP Configuration Active
If you received this email, your SMTP settings are configured correctly and emails will be sent successfully.
---
Hotel Booking System - SMTP Test
""".strip()
await send_email(