renderEmail.ts loops over To recipients and re-sends shared CC/BCC on every iteration with no cross-send deduplication.dedupePeopleByIdentity / resolveContactIdentity). That behavior should remain unchanged.ccEmails are merged into the current send only and deduped within that single send. They do not prevent the same CC address from receiving duplicate emails across multiple To sends.sendManualEmail (activity / send-manual flows): it loops over toEmails and attaches the full ccEmails / bccEmails arrays on each iteration.Confirmed repro (action-flow / template send):
Required behavior:
Related behavior that should remain unchanged:
src/util/functions/emailBuilder/renderEmail.ts. sendProductionEmails maps over dedupedToPeople and calls sendToRecipient for each To person with shared dedupedCCPeople and dedupedBCCPeople. Entry: src/util/functions/actionFlows/handleEventTriggerdByBull.ts → renderEmailFromTemplate.sendManualEmail in the same file loops over toEmails and attaches full ccEmails / bccEmails on each iteration. Entry points include src/routes/flowActionResults.ts and src/routes/emailBuilder.ts. The same cross-send CC/BCC dedup fix must apply here.getDedupedToPeopleForEmailTemplate, dedupePeopleByIdentity, and resolveContactIdentity in src/util/functions/actionFlows/recipientIdentity.ts. That logic should stay focused on per-recipient To deduplication and should not be changed to collapse multiple client sends into one.normalizeEmail).primary: true on the job’s people[] entry.people[] order who is also among the deduped To recipients for this action (i.e. first matching entry in production To order derived from people[], not a separate sorted list).replaceVariablesBackend, buildEmail, and recipient-based block/condition evaluation — using the chosen shared context, not whichever To iteration runs first.ccEmails (src/models/contactSchema.ts) still participate in recipient assembly but must not cause duplicate shared sends when the same normalized address is already in CC or BCC for the action.sendProductionEmails and sendManualEmail.people.primary when set on a matching To recipient; otherwise uses the first client-role To recipient in people[] order.src/util/functions/emailBuilder/renderEmail.ts — sendProductionEmails, sendToRecipient, sendManualEmail, dedupePeopleByIdentitysrc/util/functions/actionFlows/recipientIdentity.ts — resolveContactIdentity, normalizeEmailsrc/util/functions/actionFlows/handleEventTriggerdByBull.tssrc/routes/flowActionResults.ts — manual sendsrc/routes/emailBuilder.ts — manual sendsrc/models/contactSchema.ts — ccEmailsPlease authenticate to join the conversation.
Planned
Main App
2 days ago
Linear
Get notified by email when there are changes.
Planned
Main App
2 days ago
Linear
Get notified by email when there are changes.