Description
Implement email notification functionality for leave requests and status updates using the react-email library. This enhancement will improve communication between employees, supervisors, and HR by sending automated emails for leave requests and their status changes.
Features to Implement
- Email notification to supervisor when a leave request is submitted.
- Email notification to employee when leave status is updated.
- CC HR department on leave status update emails.
- Contact form email functionality for the landing page.
Technical Tasks
- Install and set up react-email library.
- Create email templates for different notification types.
- Implement email sending functionality.
- Integrate email notifications into existing leave request and update processes.
- Create an API route for the contact form email.
File Updates
- Create new files:
emails/LeaveRequestEmail.tsx
emails/LeaveStatusEmail.tsx
emails/ContactFormEmail.tsx
lib/email.ts
- Update existing files:
app/(portal)/portal/RequestForm.tsx
app/(dashboard)/dashboard/leaves/EditLeave.tsx
app/api/send/route.ts (new file for contact form API route)
app/page.tsx (update contact form to use new API route)
Implementation Details
- Create email templates using react-email components.
- Implement sendEmail function in
lib/email.ts to handle email sending logic.
- Update RequestForm to send email notification when a leave request is submitted.
- Update EditLeave to send email notification when leave status is updated, including CC to HR.
- Create an API route for the contact form and integrate it with the landing page.
Acceptance Criteria
Additional Considerations
- Use environment variables for email configuration (SMTP settings, email addresses).
- Implement email queue system for better performance and reliability.
- Add unit tests for email sending functionality.
- Consider implementing email templates preview functionality for easier development and testing.
Please update the mentioned files and create the new email-related files to fully integrate the email notification functionality across the application.
Description
Implement email notification functionality for leave requests and status updates using the react-email library. This enhancement will improve communication between employees, supervisors, and HR by sending automated emails for leave requests and their status changes.
Features to Implement
Technical Tasks
File Updates
emails/LeaveRequestEmail.tsxemails/LeaveStatusEmail.tsxemails/ContactFormEmail.tsxlib/email.tsapp/(portal)/portal/RequestForm.tsxapp/(dashboard)/dashboard/leaves/EditLeave.tsxapp/api/send/route.ts(new file for contact form API route)app/page.tsx(update contact form to use new API route)Implementation Details
lib/email.tsto handle email sending logic.Acceptance Criteria
Additional Considerations
Please update the mentioned files and create the new email-related files to fully integrate the email notification functionality across the application.