Skip to content

feat(email): add HTML workspace invite email#661

Merged
param20h merged 3 commits into
param20h:devfrom
nancysangani:feature/442-workspace-invite-email
Jun 23, 2026
Merged

feat(email): add HTML workspace invite email#661
param20h merged 3 commits into
param20h:devfrom
nancysangani:feature/442-workspace-invite-email

Conversation

@nancysangani

Copy link
Copy Markdown
Contributor

Closes #442

📝 What does this PR do?

When a user is invited to a workspace, the backend now immediately dispatches a branded HTML invitation email with workspace details and a one-click acceptance link.

Changes:

  • Added send_workspace_invite_email() to backend/app/email_service.py — builds a table-based HTML email with:
    • Indigo → purple branded header
    • Workspace name + invitation copy
    • Optional personal message block (only rendered when inviter adds a note)
    • Prominent "Accept Invitation →" CTA button
    • Amber expiry notice (e.g. "⏳ expires in 72 hours")
    • Auto-generated plain-text fallback for clients that don't render HTML
  • Updated backend/app/routes/workspaces.py to call send_workspace_invite_email() instead of the old hand-rolled plain-text body

🗂️ Type of Change

  • ✨ New feature
  • 🔧 Refactor / code cleanup
  • 🧪 Tests

🧪 How was this tested?

  • Added / updated tests

9 unit tests added in backend/tests/test_workspace_invite_email.py:

Test Asserts
test_delegates_to_send_email send_email called exactly once
test_subject_contains_workspace_name Subject includes workspace name
test_html_body_contains_invite_link HTML contains acceptance URL
test_html_body_contains_workspace_name HTML contains workspace name
test_html_body_contains_expiry Expiry hours present in HTML
test_personal_message_included_in_html Optional message block rendered
test_no_personal_message_omits_block Block absent when no message
test_plain_text_body_contains_invite_link Plain-text fallback has URL
test_recipient_passed_to_send_email Correct recipient address

✅ Self-Review Checklist

  • My branch is based on dev, not main
  • I have not added any secrets / API keys
  • I have not modified main branch or any HuggingFace deployment config
  • My code follows the existing style (no unnecessary formatting changes)
  • I have updated relevant docs / comments if needed

@nancysangani nancysangani requested a review from param20h as a code owner June 22, 2026 08:15
@nancysangani

Copy link
Copy Markdown
Contributor Author

Hi @param20h, please review the PR when you get a chance. Thanks!

@param20h param20h merged commit 7e3838f into param20h:dev Jun 23, 2026
7 checks passed
@github-actions github-actions Bot added gssoc GirlScript Summer of Code 2026 issue/PR gssoc:approved Approved for GSSoC base points (+50 pts) level:intermediate +35 pts mentor:param20h Mentor for this PR type:backend Backend API labels Jun 23, 2026
@github-actions

Copy link
Copy Markdown

🎉 Congratulations on getting your Pull Request merged! 🎉

Thank you for contributing to PDF-Assistant-RAG as part of GSSoC '26! 🚀

Keep up the great work! ✨

@param20h param20h added type:feature +10 pts and removed type:backend Backend API labels Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved Approved for GSSoC base points (+50 pts) gssoc GirlScript Summer of Code 2026 issue/PR level:intermediate +35 pts mentor:param20h Mentor for this PR type:feature +10 pts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(api): Implement email notifications for workspace invites

2 participants