Guides/Automate emails on form submission

Automate emails on form submission

Form submits, email sends. No code.

Updated March 2026

The most common automation pattern: a form receives a submission, and an email goes out. This guide creates a form, an email template, and an automation that connects them. When someone submits the form, the automation fires the send_email step with the submission data interpolated into the template. No webhook plumbing, no code -- just a declarative pipeline.

1. Create a form

Create a form to collect submissions. This example creates a contact form with name, email, and message fields.

curl -X POST https://sutrena.com/api/forms \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Contact Form",
    "fields": [
      { "name": "name", "label": "Name", "type": "text", "required": true },
      { "name": "email", "label": "Email", "type": "email", "required": true },
      { "name": "message", "label": "Message", "type": "textarea", "required": true }
    ]
  }'

# Save the formId from the response

2. Create an email template

POST to /api/email-templates with a subject and HTML body. Use {{placeholder}} syntax for dynamic values. The template is reusable across automations.

curl -X POST https://sutrena.com/api/email-templates \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Contact Notification",
    "subject": "New contact from {{name}}",
    "body": "<h2>New Contact Form Submission</h2><p><strong>From:</strong> {{name}} ({{email}})</p><p><strong>Message:</strong></p><p>{{message}}</p>"
  }'

# Save the template ID from the response

3. Create the automation

Create an automation with a form_submission trigger linked to your form. The send_email step references the template and interpolates trigger data (the submitted form fields).

curl -X POST https://sutrena.com/api/automations \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Email on contact submit",
    "slug": "contact-notify",
    "trigger": {
      "type": "form_submission",
      "formId": "FORM_ID"
    },
    "steps": [
      {
        "type": "send_email",
        "templateId": "TEMPLATE_ID",
        "to": "[email protected]",
        "data": {
          "name": "{{trigger.name}}",
          "email": "{{trigger.email}}",
          "message": "{{trigger.message}}"
        }
      }
    ]
  }'

4. Submit the form to test

Submit data to the form's public endpoint. The automation triggers automatically and sends the email. No auth needed for form submission.

curl -X POST https://sutrena.com/api/forms/FORM_ID/submit \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Jane Doe",
    "email": "[email protected]",
    "message": "Hello, I would like to learn more about your product."
  }'

5. Verify in execution logs

Check the automation logs to confirm the email was sent. The log shows the trigger source, status, and duration.

curl https://sutrena.com/api/automations/AUTOMATION_ID/logs \
  -H "Authorization: Bearer $KEY"

# Response:
# {
#   "data": [
#     {
#       "triggeredBy": "form_submission",
#       "status": "success",
#       "stepsExecuted": 1,
#       "durationMs": 320,
#       "error": null
#     }
#   ]
# }

FAQ

Can I send the email to the person who submitted the form?

Yes. Set the to field to "{{trigger.email}}" to send to the submitter's email address. You can also send to multiple recipients by using a comma-separated string.

What are the email limits?

Free: 0 emails/month (email steps are unavailable). Pro: 10K/month. Scale: 100K/month. The counter resets on the first of each month.

Can I add conditions before sending?

Yes. Add a condition step before the send_email step. Example: only send if the message field is not empty, or only send for certain form field values. Use the condition step's if/then/else to branch.

How is this different from the emailTo field on forms?

The emailTo field on forms sends a simple notification email with all fields listed. Automations give you full control: custom email templates, conditional logic, multiple recipients, and additional steps like creating page entries or updating submissions in the same pipeline.

Can I use the same automation for multiple forms?

Each automation has one trigger linked to one form. Create separate automations for each form. You can reuse the same email template across all of them.

What is Sutrena?

Sutrena is the web runtime for AI agents. Forms, Pages, Dashboards, Analytics, Webhooks, Automations, Emails — all through 75 MCP tools and one REST API. Your agent creates web artifacts, humans interact with them, and your agent gets the data back. Use any one feature or all of them together.

Pages

Deploy HTML instantly

Forms

Collect structured data

Dashboards

Visualize with 7 widget types

Analytics

Privacy-first, no cookies

Webhooks

Slack, Discord, Telegram

Get started in two API calls

1. Get a trial key (no auth, no signup)

curl -X POST https://sutrena.com/api/trial

2. Create anything — a page, form, dashboard, or analytics site

# Create a form with a dashboard
curl -X POST https://sutrena.com/api/forms \
  -H "Authorization: Bearer st_trial_xxx" \
  -H "Content-Type: application/json" \
  -d '{"workflowId": "waitlist", "createDashboard": true}'

# Or deploy a page
curl -X POST https://sutrena.com/api/pages \
  -H "Authorization: Bearer st_trial_xxx" \
  -H "Content-Type: application/json" \
  -d '{"slug": "index", "title": "My Site", "html": "<h1>Live</h1>"}'

Ready to build?

Get a trial API key instantly with no signup, or create an account for the full experience.

Automate emails on form submission -- form + template + automation | Sutrena | Sutrena