-
Notifications
You must be signed in to change notification settings - Fork 19
Labels
BackendBackend Related IssueBackend Related IssueFrontendFrontend Related IssueFrontend Related IssueNew FeatureNew feature to be implementedNew feature to be implemented🌱Nice-to-HaveEnhancements, Refactors, UI tweaks, or non-critical optimizationsEnhancements, Refactors, UI tweaks, or non-critical optimizations
Milestone
Description
📋 Objective
Extend the email system to send non-authentication notification emails such as:
- Team invitations ->
Not in Current Version - Document share confirmations
- Link access notifications (e.g., "someone viewed your document")
The developer will integrate notification-style transactional emails into the app using the emailService created in Issue 3. These must be decoupled from any specific email provider (e.g., SendGrid, Brevo) and instead use the abstracted service structure already implemented.
🛠️ Tasks
- Review the implementation in Issue 3 and ensure the
emailServiceis available across the app. - Create notification templates (HTML or plain-text) that support:
- Invitation to a team (basic email with recipient name, sender name, and CTA link)
- Document shared with you
- Document was viewed (include doc name, time)
- Define new reusable functions under
emailService(e.g.,sendInviteEmail,sendViewNotification) that accept:- Email address
- Dynamic fields (name, link, doc title, etc.)
- Ensure emails:
- Respect the environment toggle (no send in local/dev unless explicitly enabled)
- Fail gracefully if config is missing
- Add appropriate error handling and logging if email sending fails
- Use any existing toast notifications to provide frontend feedback (e.g., “Invite sent” / “Failed to send email”)
- Integrate into an existing flow — preferably:
- The Document Share flow (when a user shares a document via email)
NEW
- The Document Share flow (when a user shares a document via email)
- Validate end-to-end:
- Trigger → Email logs in dev tools or provider → UI feedback
🔄 Guidelines
- Do not directly import any email provider SDK or client (e.g., SendGrid SDK).
All logic should go through the sharedemailService. - Templates can be plain HTML or string-based templates (no React-email unless approved).
- If unsure where to integrate emails, consult Mahid before proceeding.
- Keep code modular and testable — individual email sending functions should be easily reused.
🧪 Testing Tips
- Temporarily enable
SEND_EMAILS=trueand fill in credentials to test with a real provider (use test email). - Review email logs in your provider dashboard.
- Verify that placeholders and dynamic content are rendered correctly.
- Test fail-scenarios by:
- Disabling API key in
.env - Passing bad email address
- Sending from unauthorized domain (depending on provider)
- Disabling API key in
📎 Deliverables
- Email templates for at least 2–3 notification scenarios
- All new email types integrated via
emailService - Updated PR with:
- Screenshots of email templates (if rendered HTML)
- Clear commit messages
- Link to any issue this is tied to (e.g., invite functionality)
Depends on: Completion of Issues 1–3 (Provider setup, env vars, email service abstraction)
Metadata
Metadata
Assignees
Labels
BackendBackend Related IssueBackend Related IssueFrontendFrontend Related IssueFrontend Related IssueNew FeatureNew feature to be implementedNew feature to be implemented🌱Nice-to-HaveEnhancements, Refactors, UI tweaks, or non-critical optimizationsEnhancements, Refactors, UI tweaks, or non-critical optimizations