Notion Integration
Create a new page in a Notion database for each form submission.
Action type: notion
Class: Core_Forms\Actions\Notion
Source: src/actions/class-notion.php
Setup
1. Create a Notion Integration
- Go to notion.so/my-integrations.
- Click New integration, give it a name, and select the workspace.
- Copy the Integration Token (starts with
secret_...).
2. Share the Database
- Open the Notion database you want to receive submissions.
- Click Share (or the
...menu) and invite your integration. - Copy the Database ID from the URL:
https://notion.so/{workspace}/{DATABASE_ID}?v=...(the 32-character hex string).
3. Configure in Core Forms
- Edit your form > Actions tab > Add Action > Add to Notion.
- Paste the Integration Token and Database ID.
- Optionally configure field mapping.
Settings Reference
| Setting | Required | Default | Description |
|---|---|---|---|
| Integration Token | Yes | -- | Notion internal integration token (secret_...) |
| Database ID | Yes | -- | 32-character ID from the database URL |
| Field Mapping | No | Auto-map | Maps form fields to Notion database properties |
Field Mapping Format
One mapping per line, form_field=Notion Property:
name=Name
email=Email
message=Message
company=Company
When left empty, form fields are auto-mapped using the field name with underscores replaced by spaces and the first letter capitalized (e.g., first_name becomes First name).
How Properties Are Created
- The Name property (title type, required by Notion) is always set to
{Form Title} -- {timestamp}. - All other properties are created as rich_text type.
- Values are truncated to 2,000 characters (Notion API limit for rich text).
- Array values (checkboxes, multi-select) are joined with commas.
Example
Form with name, email, phone, and message fields, mapped as:
name=Contact Name
email=Email Address
message=Inquiry
Creates a Notion page with: - Name (title): "Contact Form -- 2026-04-09 10:30:00" - Contact Name (rich_text): "Jane Smith" - Email Address (rich_text): "jane@example.com" - Inquiry (rich_text): "I'd like to learn more." - Phone (rich_text, auto-mapped): "555-0100"
How It Works
- Parses the field mapping configuration.
- Builds Notion API properties with the title property set to form title + timestamp.
- POSTs to
https://api.notion.com/v1/pageswith the database parent and properties. - Uses Notion API version
2022-06-28. - The request times out after 20 seconds.
- Returns
trueif the response status is below 400.
Troubleshooting
- "Could not find database": Ensure the database is shared with the integration. Click Share on the database page and add the integration.
- Property type mismatch: All fields are sent as rich_text. If your Notion database has properties with other types (number, select, date), the API may reject them. Adjust your database property types to accept rich text.
- Token format: The token must start with
secret_. Internal integrations only -- OAuth tokens are not supported.