Skip to content
← All documentation

Dashier documentation

Send email when a new record is created

Configure a source-level record-created hook, reusable plain-text email template, fixed recipient, optional reply-to field, and server-side Resend delivery.

Dashier can send an email after a row is added to a source. The hook listens for record.created events created by the dashboard or REST API. CSV/JSON imports enqueue one event per inserted row; an import request attempts up to 25 deliveries, and remaining items can be processed from the source’s Email hooks tab. This is a source-level notification hook, not a general workflow engine.

1. Define the source

Create a source for the submissions, such as Contact submissions, with typed fields like name (text), email (email), subject (text), and message (textarea). Use those field keys in the API payload and template. Dashier provides the record and notification; your application still needs to build the visitor-facing form and validate its input.

2. Create a plain-text template

In the source’s Email hooks tab, add a template. A subject might be New website enquiry from {{name}}; the body can include the sender’s name, email, subject, and message. Insert source keys as {{fieldkey}}. Supported metadata variables are {{record.id}}, {{record.createdat}}, {{source.name}}, and {{source.slug}}. Tokens are checked against the schema, and the provider receives plain text, not HTML.

3. Configure the hook

Choose the template and enter a fixed recipient address controlled by your team. Optionally select an email-typed source field as reply-to. Row data cannot choose the recipient, so a public submission cannot turn this hook into an arbitrary-recipient relay. Pause the hook before a bulk import when needed.

4. Configure Resend on the server

Dashier sends through the Resend Email API only when the deployment operator sets RESENDAPIKEY and RESENDFROMEMAIL as server-only environment variables. Verify the sender/domain in Resend. Never put the API key in a NEXTPUBLIC variable, browser bundle, source code, or version control. If the variables are absent, deliveries are marked blocked and can be retried after configuration.

5. Submit through your server route

For an authenticated integration, make the source POST policy Authenticated and use a write-scoped key kept in the website server environment. Your server route should validate incoming fields and POST JSON to /api/v1/contact-submissions with x-api-key. Do not send the key from browser JavaScript. An anonymous POST policy is possible only when you intentionally want anyone to call it; rate-limit and validate that path in your application.

After a valid row is committed, Dashier queues an email for each enabled hook and does not roll back the row if the provider fails. The delivery screen shows status, and sent items retain a provider message identifier; email body and recipient are not copied into the delivery log. Each hook allows at most 50 successful sends in a rolling hour. Retries are manual, and Resend idempotency keys protect duplicate requests during the provider’s documented 24-hour window.

6. Test the whole path

Create one test record with a controlled address and inspect delivery history and the provider dashboard. Test malformed values, a paused hook, and missing provider configuration. For imports, inspect the pending count and process batches of up to 25 from Email hooks. Provider acceptance does not guarantee mailbox delivery or display.

See the contact-form walkthrough for a server-route example. Dashier currently supports the record.created event and plain-text templates; it does not provide arbitrary workflow code, HTML templates, attachments, or a configurable per-hook sender. See Resend’s email API documentation for provider requirements.