feat: add super admin user assignment, scoping, and clean email notifications

This commit is contained in:
Atharv1705
2026-10-30 16:07:46 +05:30
parent 1cca347752
commit b7c935df5a
13 changed files with 680 additions and 105 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ async def send_email(to: str, subject: str, body: str) -> bool:
if smtp_password:
smtp_password = smtp_password.replace(" ", "")
mail_from_email = os.getenv("MAIL_FROM") or smtp_user
mail_from_name = os.getenv("MAIL_FROM_NAME", "BookKeepro")
mail_from_name = os.getenv("MAIL_FROM_NAME", "Admin Portal")
smtp_tls = os.getenv("SMTP_TLS", "True").strip().lower() == "true"
smtp_ssl_tls = os.getenv("MAIL_SSL_TLS", "False").strip().lower() == "true"
+4 -4
View File
@@ -11,7 +11,7 @@ async def send_signup_welcome_email(to: str, name: str | None = None):
<p>Dear {display_name},</p>
<p>
Welcome to <strong>BookKeepro</strong> 🎉
Welcome! 🎉
</p>
<p>
@@ -26,7 +26,7 @@ async def send_signup_welcome_email(to: str, name: str | None = None):
<p>
<a href="{_FRONTEND_URL}/login"
style="color:#0077c8;font-weight:600;text-decoration:none;">
👉 Login to BookKeepro
👉 Login to Dashboard
</a>
</p>
@@ -36,12 +36,12 @@ async def send_signup_welcome_email(to: str, name: str | None = None):
<p style="margin-top:20px;">
Kind regards,<br>
<strong>BookKeepro Team</strong>
<strong>Support Team</strong>
</p>
"""
await send_email(
to=to,
subject="Welcome to BookKeepro 🎉",
subject="Welcome 🎉",
body=body
)
+3 -3
View File
@@ -63,11 +63,11 @@ def _run_deadline_reminders():
<p>This is a reminder that your <strong>{doc_label} document filing deadline</strong>
is in <strong>{label}</strong> ({dl.deadline_date.strftime('%B %d, %Y')}).</p>
<p>Please ensure all outstanding actions are completed before the deadline.</p>
<p>Kind regards,<br><strong>BookKeepro Team</strong></p>
<p>Kind regards,<br><strong>Support Team</strong></p>
"""
await send_email(
to=user.email,
subject=f"Reminder: {doc_label} Filing Deadline in {label} — BookKeepro",
subject=f"Reminder: {doc_label} Filing Deadline in {label}",
body=user_body,
)
@@ -78,7 +78,7 @@ def _run_deadline_reminders():
<strong>{user.name or user.email}</strong> ({user.email}) is in
<strong>{label}</strong> ({dl.deadline_date.strftime('%B %d, %Y')}).</p>
<p>Please review the client's status and take any necessary action.</p>
<p><strong>BookKeepro System</strong></p>
<p><strong>Admin System</strong></p>
"""
for admin_email in admin_emails:
await send_email(