# Deprecated Functions and Code This document tracks functions that have been marked as deprecated and should be removed in future releases. ## Email Parsing and Processing Functions ### 1. `splitEmailHeadersAndBody` - **Location**: `app/courrier/page.tsx` - **Reason**: Email parsing has been centralized in `lib/mail-parser-wrapper.ts` and the API endpoint. - **Replacement**: Use the `decodeEmail` function from `lib/mail-parser-wrapper.ts` which provides a more comprehensive parsing solution. - **Status**: Currently marked with `@deprecated` comment, no usages found. ### 2. `getReplyBody` - **Location**: `app/courrier/page.tsx` - **Reason**: Should use the `ReplyContent` component directly. - **Replacement**: Use `` directly. - **Status**: Currently marked with `@deprecated` comment, no direct usages found. ### 3. `generateEmailPreview` - **Location**: `app/courrier/page.tsx` - **Reason**: Should use the `EmailPreview` component directly. - **Replacement**: Use `` directly. - **Status**: Currently marked with `@deprecated` comment, no usages found. ### 4. `cleanHtml` (in server/email-parser.ts) - **Location**: `lib/server/email-parser.ts` - **Reason**: This functionality has been centralized in `lib/mail-parser-wrapper.ts`. - **Replacement**: Use `cleanHtml` from `lib/mail-parser-wrapper.ts`. - **Status**: Currently marked with `@deprecated` comment, used in `parseEmail` function. ### 5. `processHtml` (in parse-email/route.ts) - **Location**: `app/api/parse-email/route.ts` - **Reason**: HTML processing has been centralized in `lib/mail-parser-wrapper.ts`. - **Replacement**: Use `cleanHtml` from `lib/mail-parser-wrapper.ts`. - **Status**: Currently marked with `@deprecated` comment, still used in the API route. ## Deprecated API Routes ### 1. `app/api/mail/[id]/route.ts` - **Status**: Deleted - **Replacement**: Use `app/api/courrier/[id]/route.ts` instead. ### 2. `app/api/mail/route.ts` - **Status**: Deleted - **Replacement**: Use `app/api/courrier/route.ts` instead. ### 3. `app/api/mail/send/route.ts` - **Status**: Deleted - **Replacement**: Use `app/api/courrier/send/route.ts` instead. ## Migration Plan ### Phase 1: Deprecation (Current) - Mark all deprecated functions with `@deprecated` comments - Add console warnings to deprecated functions - Document alternatives ### Phase 2: Removal (Future) - Remove deprecated functions after ensuring no code uses them - Ensure proper migration path for any code that might have been using these functions - Update documentation to remove references to deprecated code