Objective
- When someone uses Share by email from a repair list view, replies should go to the job contact who actually sent the share (the same person named in the email body), not only to the company mailbox—so client care is not forced to forward every thread.
- Keep legitimate, deliverable outbound mail: decision needed on whether
Fromstays company-branded on a verified domain while routing replies viaReply-Toto the sender’s contact email (recommended pattern for SPF/DMARC), vs. changes toFromdisplay name only.
Background
Today, the envelope reads as company-sent because
handleEmailJobinattik-backend/src/util/functions/emails/sendResendTemplate.tsbuildsfromfrom verified company domain /company.name(when a Domain record exists), or falls back to a generic noreply-style address—not from the individual sharer.Reply-Tois not set on the Resend payload, so Reply targetsFrom.The
repair-list-sharetemplate (attik-backend/src/util/functions/emails/resendTemplates/repairListShareEmail.tsx) already names the sharer in the body viasenderName/senderRole, populated fromsenderContactIdonPOST /repair-list/:id/view-link-send(attik-backend/src/routes/repairList.ts). The gap is reply routing, not necessarily missing copy in the body.Product feedback: recipients perceive the company as the sender and reply there; client care must relay responses back to the original sender. Slack thread
Constraint: Putting an arbitrary contact address in
Fromusually breaks authentication vs Resend + verified domains;Reply-To: <sender email>is the usual way to preserve deliverability while steering replies to the person.
Scope
Backend
attik-backend/src/routes/repairList.ts—POST /:id/view-link-send: already resolvessenderName/senderRolefromsenderContactIdand inspection people; extend the outbound mail contract so the send path can attach reply metadata (e.g. contact email forReply-Towhen present).attik-backend/src/util/functions/emails/sendResendTemplate.ts—handleEmailJob: today setsfromandto(+ cc/bcc) onCreateEmailOptions; add support for Resend’s reply-to field when template data supplies a sender address—decision needed on validation (contact must be on the job, must have email).- Related templates that reuse the same send helper should be reviewed so
Reply-Tois only set where product intends (may stay repair-list-share-only at first).
Frontend
attik-frontend/src/app/client/repair-list/[id]/view/components/ShareViewByEmailModal.tsx— already passessenderContactIdwhen the portal provides it; confirm the selected sharer’s email is available server-side via inspection people (no need to expose in the client if the server derives it).
Product / architecture
- Decision needed: Primary goal is
Reply-To= sharer email (withFromunchanged for auth), vs. also changingFromdisplay name (e.g. “Jane via {Company}”) for readability—second is optional polish. - Decision needed: Behavior when the sharer has no email or multiple roles—fallback to current behavior (reply to company) vs. block send.
References
- Slack — share-by-email sender vs company
- Resend API —
reply_to/ email payload fields (align withCreateEmailOptionsin code) attik-backend/src/routes/repairList.ts—view-link-sendattik-backend/src/util/functions/emails/sendResendTemplate.tsattik-backend/src/util/functions/emails/resendTemplates/repairListShareEmail.tsxattik-frontend/src/app/client/repair-list/[id]/view/components/ShareViewByEmailModal.tsx