Skip to content

Admin: "Copy as email reply" button on entry detail #3

Description

@nipun-arora

Common flow when a lead comes in: open the entry, then hand-copy the fields into an email reply. Worth automating.

Add a "Copy as email reply" button to the entry detail view (packages/astro-forms/src/server/admin/entry-detail.astro) that formats the captured fields into a plain-text draft and puts it on the clipboard.

Something like:

Hi {name},

Thanks for reaching out.

> Your message:
> {message field, quoted}

---
Submitted {date} via {form id}

Implementation notes:

  • navigator.clipboard.writeText() in a small inline script; progressive enhancement, so the button can be hidden when clipboard API is unavailable.
  • Field mapping should be dumb: name-ish field, email-ish field, message-ish field, then everything else as a key/value block. Don't over-engineer detection.
  • Show a brief "copied" confirmation on the button itself.

No server changes needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions