Skip to content

fix: include incoming email To recipients in the reply CC - #68

Open
limehawk wants to merge 1 commit into
chatwoot:mainfrom
limehawk:fix/reply-cc-includes-incoming-to
Open

fix: include incoming email To recipients in the reply CC#68
limehawk wants to merge 1 commit into
chatwoot:mainfrom
limehawk:fix/reply-cc-includes-incoming-to

Conversation

@limehawk

Copy link
Copy Markdown

Fixes #67

getRecipients hardcodes to: [] in the incoming branch, so the step that copies an incoming email's extra To recipients into the reply cc always receives an empty array. Anyone the sender addressed in To (rather than CC) falls off the thread when an agent replies.

Change: pass the email's actual To list (to: email?.to || []). The existing downstream logic already does the rest: To recipients are only merged into cc for incoming emails, and the filters remove the inbox address, the forward-to address, and the contact. This restores the behavior from before #43.

Tests: added a To Recipients block for incoming emails (extra To recipient lands in cc, inbox address is filtered, works alongside existing cc, to: null is safe) and added the missing to field to the incoming fixture. Full suite: email.test.ts passes; the only failures are 3 pre-existing ones in date.test.ts, also failing on main unmodified.

The incoming branch of getRecipients hardcoded 'to: []'. The step that
copies extra To recipients into the reply CC always received an empty
array. Recipients the sender addressed in To, rather than CC, fell off
the thread on reply.

Pass the email's actual To list. The existing filters still remove the
inbox address, the forward-to address, and the contact.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

getRecipients drops incoming email To recipients from the reply CC

1 participant