Forward email to external recipient#296
Open
mageaustralia wants to merge 1 commit intoabhinavxd:mainfrom
Open
Conversation
Adds an end-to-end "forward this email" feature with internal-thread filtering so back-and-forth with the forwarded recipient never leaks into customer-facing replies. Backend - New `forwarded_to` field on the send-message request. When non-empty the message is routed to those addresses instead of the conversation contact; CC/BCC pass through unchanged so an agent can loop in internal teammates. - At SMTP send: forwards strip In-Reply-To/References so the recipient sees a fresh thread, and prepend "Fwd: " to the subject (idempotent). - Activity-note logging records who forwarded to whom. - New `is-source-id-from-forward` SQL + intake hook: any incoming message whose In-Reply-To/References point at a previously-sent forward (or already-tagged reply chain) gets `meta.from_forward = true`. Empty source-IDs are filtered out before the lookup. Frontend - Per-message Forward button on email-channel, non-private bubbles. - ReplyBox listens for the forward event (via lifecycle hooks, with matching .off on unmount), switches into a new `forward` mode, pre-quotes the original message, and clears recipient fields. - Forward tab is only visible while in forward mode. - Switching conversations or tabs out of `forward` resets the pre-quoted body and recipient fields so a stale forward can't be accidentally sent into a different conversation. - Forward-related bubbles (outgoing forward + incoming reply-to-forward) share the private-note bubble color so the internal thread groups visually distinct from customer-facing messages. - Small "Forwarded to:" badge on outgoing forwards and "Reply to forward (internal)" badge on tagged incoming.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
End-to-end "forward this email" feature with internal-thread filtering so back-and-forth with a forwarded recipient never leaks into customer-facing replies.
Backend
forwarded_tofield on the send-message request. When set, the message is routed to those addresses instead of the conversation contact; CC/BCC pass through unchanged so an agent can loop in internal teammates on the forward.In-Reply-To/Referencesso the recipient sees a fresh thread, and prependFwd:to the subject (idempotent).is-source-id-from-forwardSQL + intake hook: any incoming message whoseIn-Reply-To/Referencespoint at a previously-sent forward (or an already-tagged reply chain) getsmeta.from_forward = true. Empty source-IDs are filtered before the lookup; the from_forward check usesjsonb @> '...'containment so it never throws on unexpected meta shapes.Frontend
onMounted/onBeforeUnmountwith matching.off), switches into a newforwardmode, pre-quotes the original message, and clears recipient fields.forwardresets the pre-quoted body and recipient fields so a stale forward can't be accidentally sent into a different conversation.Pairs especially well with #289 (CID inline-image embed) — without that PR, forwarded inline images use signed URLs that expire ~1 hour later. This PR works without #289 but with that lifetime caveat.
Test plan
---- Forwarded message ---- From: ... Date: ...+ the original bodyFwd: <subject>, noIn-Reply-To, recipients include CC; bubble shows in creambg-privatecolor with "Forwarded to: ..." badge