-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Feature: Inbound Email to Task Automation
🎯 Objective
Allow clients to create tasks automatically by sending an email to a designated inbound address (e.g., tasks@yourdomain.com). The system should identify the client by their sender address and store any attachments in R2.
Below is suggested plan, but please evaluate based on current codebase and PLAN path forward before making code changes.
🛠️ Implementation Steps
1. Resend Configuration
- Configure Inbound Mail in the Resend Dashboard.
- Point the Webhook URL to something like
https://yourdomain.com/api/webhooks/inbound. - Secure the endpoint using a
RESEND_WEBHOOK_SECRET.
2. Webhook Logic (/api/webhooks/inbound)
- Sender Verification: Extract the
fromaddress and query the Supabaseclientstable. - Content Parsing: Extract
subject(Task Title) andtextorhtml(Task Description). - Attachment Handling: - Loop through the
attachmentsarray provided by Resend.- Fetch the file from the Resend
download_url. - Stream the buffer to Cloudflare R2 using the
@aws-sdk/client-s3. - Store the R2 public URL (or key) in a
task_attachmentstable in Supabase.
- Fetch the file from the Resend
3. Database Schema Updates
- Ensure
taskstable has aclient_idforeign key. - (Optional) Create
task_attachmentstable:create table task_attachments ( id uuid default uuid_generate_v4() primary key, task_id uuid references tasks(id), file_url text, file_name text );
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request