Skip to Content

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

PropTypeDescription
openbooleanModal open state
onOpenChange(open: boolean) => voidOpen state handler
entityEntityEntity context
entityConfigEntityConfigEntity configuration
emailUrlstringAPI endpoint to POST the email
defaultTostringPre-fill recipient email
onSuccess() => voidCalled after sending

Last updated on