Email Modal
EmailModal provides a compose interface for sending an email in the context of an entity (e.g., sending an invoice to a client).
Import
import { EmailModal } from "@phpcreation/frontend-crud-react-nextjs-bundle/components/EmailModal";Usage
import { EmailModal } from "...";
<EmailModal
open={emailOpen}
onOpenChange={setEmailOpen}
entity={entity}
entityConfig={entityConfig}
emailUrl={`/api/invoices/${entity.id}/email`}
defaultTo={entity.clientEmail}
onSuccess={() => setEmailOpen(false)}
/>Props
| Prop | Type | Description |
|---|---|---|
open | boolean | Modal open state |
onOpenChange | (open: boolean) => void | Open state handler |
entity | Entity | Entity context |
entityConfig | EntityConfig | Entity configuration |
emailUrl | string | API endpoint to POST the email |
defaultTo | string | Pre-fill recipient email |
onSuccess | () => void | Called after sending |
Related
Last updated on