How to Automatically Email a Table Export as an Attachment

Updated July 2026 • 6 min read • By Fahad Murtaza • By Fahad Murtaza

TableCrafter table builder, connect Gravity Forms, Google Sheets, Airtable, CSV, or JSON data sources
TableCrafter table builder, connect Gravity Forms, Google Sheets, Airtable, CSV, or JSON data sources

Sending a fresh copy of your data table to stakeholders every morning, without touching WordPress, is one of those things that sounds like it requires a custom developer build. With TableCrafter Pro, it is a configuration step. This guide walks through combining TableCrafter's scheduled export and email alert features so a CSV or Excel attachment lands in any inbox on your schedule. WordPress powers 43% of all websites globally (W3Techs, July 2026), and TableCrafter bridges the gap between the data you collect and the tables your users need to see, no custom PHP, no dashboard access required for viewers. The free version on WordPress.org supports CSV, JSON, Google Sheets, and Excel. Pro adds Gravity Forms, Airtable, Notion, WooCommerce, REST APIs, inline cell editing, export to CSV, Excel, and JSON, role-based column visibility, and auto-refresh. Every table embeds on any page with a [tablecrafter] shortcode or the native Gutenberg block. CSV remains the most universally supported data exchange format, used by 91% of business intelligence tools (Gartner, 2025).

What You Need Before You Start?

This workflow requires the following:

After completing this step, verify the result by viewing the page as a logged-out visitor in an incognito window. This confirms the table behaves correctly for public visitors rather than reflecting admin-level permissions that may hide configuration issues during initial setup. Check both the rendered output and the browser console for any JavaScript errors.

Note: TableCrafter routes all email alerts through wp_mail() so they respect whatever mail transport your site already uses, including transactional providers like SendGrid, Mailgun, or Postmark.

Step 1: Enable export on your table

Open the table you want to send. Go to TableCrafter → Tables, hover over the table name, and click Edit. Inside the table builder, locate the Export tab in the settings panel on the right side.

Toggle Enable Export on. Three format checkboxes appear:

Select at least one format. For automated email attachments, CSV and Excel are the most practical choices because they stay small even with thousands of rows and open directly in Excel or Google Sheets without any conversion step.

You can also configure which columns appear in the export independently from what is displayed in the table. Use the Column Visibility picker to hide columns from the on-screen table while still including them in the export, or vice versa, useful when you want to expose internal IDs to the email recipient but not to website visitors.

Tip: If your table uses role-based column permissions, the export respects them. A column marked visible only to Administrators will not appear in exports triggered by Editor-level or lower accounts.

Step 2: Configure the email alert

Still inside the table builder, navigate to the Scheduled export section. This controls the recurrence, file format, and the optional email delivery for each automated export run.

The key settings for a scheduled attachment workflow are:

Each export run writes the file to wp-content/uploads/gravity-tables-exports/ first, then emails it to configured recipients if any are set. A mail delivery failure does not cancel or retry the export run; the file on disk is the primary output and is always written regardless of email success. Recipients receive the file as a standard attachment via wp_mail(), routed through whatever SMTP provider your site already uses.

Security note: Think carefully about what data you are sending and to whom before enabling exports. TableCrafter does not encrypt email attachments in transit beyond what your mail provider offers. For sensitive data, consider restricting recipients to internal addresses and using a provider with TLS enforcement.

What Is Step 3, Choose a Trigger: Scheduled vs. Event-Based?

TableCrafter Pro supports two families of triggers for email alerts:

Scheduled (Time-Based)

In the Scheduled export section, enable the export toggle and choose a recurrence:

Hourly      - runs every hour
Every 6h    - runs every six hours
Daily       - runs once per day
Weekly      - runs once per week

Each run writes the export file to wp-content/uploads/gravity-tables-exports/ using the filename pattern you configure. The file is written to disk on every run, and emailed to configured recipients if any are set. Use the Run export now button at the bottom of the Scheduled export section to trigger an immediate run for testing, bypassing the cron schedule entirely.

Scheduled exports run via WordPress Cron (wp-cron.php). On sites with consistent traffic, WP Cron fires close to the scheduled interval. On low-traffic or development sites, the cron hook waits for a page visitor to trigger it, which can cause runs to slip by an hour or more. To guarantee on-time delivery, configure a true server-level cron job to request https://yoursite.com/wp-cron.php on the same interval. Most hosting control panels expose this under Cron Jobs or Scheduled Tasks; the command is typically curl -s https://yoursite.com/wp-cron.php > /dev/null 2>&1.

Event-Based

The Email Alerts (Pro) section of the table builder handles event-driven notifications. These fire when a field value crosses a configured threshold as a result of a write action, not on a schedule. The write actions that can trigger an alert are:

The alert fires only on the crossing moment: the new value must satisfy the configured condition and the old value must not have. This prevents repeated notifications when a field already exceeds the threshold and gets updated again without recrossing. Each alert rule specifies one Field ID, one operator (such as >, <, =, >=, <=, or contains), one threshold value, and one recipient address. Configure separate rules targeting the same field if you need the same condition to notify multiple people.

The alert email subject is auto-generated: [TableCrafter Alert] Field "field name" crossed threshold on table "table name". The body includes the field label, old value, new value, the condition that was crossed, and a direct link to the table editor in your WordPress admin. When the attach_csv flag is set on a rule, the email includes a CSV export of the full table at the moment the alert fired, giving the recipient complete context rather than just the changed value.

Combining both: You can have a Scheduled export running daily to the whole team and separate threshold-based Email Alert rules firing immediately to a supervisor when a field value crosses a condition. Each is configured in its own section of the table builder and operates independently.

Step 4: Test before going live

Save your table settings. Use the Run export now button at the bottom of the Scheduled export section to trigger an immediate export run. This bypasses the cron schedule and delivers the export file to configured recipients right away, letting you verify the file contents and email delivery before the first scheduled run fires.

Check the following when the test email arrives:

If the test email does not arrive within a few minutes, check your host's mail logs or your SMTP plugin's log. All TableCrafter AJAX calls and background tasks go through wp-admin/admin-ajax.php with nonce validation, so a failed email is almost always a mail transport issue rather than a TableCrafter configuration problem.

What Is Advanced: Filtering the Export by Role or Query?

Pro TableCrafter's role-based permissions apply at the table level and the column level, but you can also narrow the data included in a scheduled export using the table's Advanced Filters before saving.

For example, suppose you manage multiple drivers and want each region manager to receive only their drivers' load data. The approach is:

  1. Create a separate table per region with an Advanced Filter applied locking the region field to the relevant value.
  2. Configure a scheduled email alert on each table pointing to the appropriate manager's address.
  3. All three tables can read from the same underlying Gravity Form, TableCrafter handles the query filtering at render and export time.

This avoids any custom PHP and keeps everything inside the TableCrafter admin interface. Each manager gets a scoped export with no risk of seeing another region's data.

[tablecrafter id="42"]
[tablecrafter id="43"]
[tablecrafter id="44"]

Each shortcode renders the appropriate region's table on the front end, and each table's scheduled export emails the matching manager. Embed each table using the canonical [tablecrafter id="X"] shortcode format.

Data sources beyond Gravity Forms: The email export works with all TableCrafter data sources. If your table pulls from Google Sheets, REST API, Airtable, or WooCommerce, the attachment contains whatever rows that source returns after filters are applied. There is no Gravity Forms dependency for the export or email features.

Frequently Asked Questions

Step 1: Enable export on your table

Open the table you want to send. Go to TableCrafter → Tables, hover over the table name, and click Edit. Inside the table builder, locate the Export tab in the settings panel on the right side.

What Is TableCrafter?

TableCrafter is a WordPress plugin that turns data from Gravity Forms, Google Sheets, Airtable, Notion, REST APIs, CSV files, and WooCommerce into interactive, sortable, filterable frontend tables. Embed any table on any WordPress page with the [tablecrafter] shortcode or the native Gutenberg block. No PHP or custom development required. The free version supports CSV, JSON, Google Sheets, and Excel. Pro adds Gravity Forms, Airtable, Notion, WooCommerce, REST APIs, inline cell editing, export to CSV, Excel, and JSON, role-based column visibility, and auto-refresh.

Does this require PHP or developer skills?

No. TableCrafter is configured entirely through the WordPress admin interface. You choose your data source, map fields to columns, and set display preferences using point-and-click controls. Embedding uses the [tablecrafter] shortcode or the native Gutenberg block.

Is the free version sufficient or do I need Pro?

The free plugin on WordPress.org supports CSV, JSON, Google Sheets, and Excel sources with unlimited tables, rows, and columns. Pro adds Gravity Forms, Airtable, Notion, WooCommerce, REST API sources, inline cell editing, bulk row actions, export to CSV, Excel, and JSON, role-based column visibility, and auto-refresh every N seconds.

Ready to try it?

TableCrafter is free on WordPress.org. Pro unlocks inline editing, role-based permissions, and advanced data sources.

Column order is preserved across sessions. Once you set a column order in the table builder, that order persists in the shortcode output for all visitors. Users with the column reorder permission can adjust their own view without affecting the default seen by others.

The column mapping you define here is stored as a JSON configuration in the WordPress database. You can export this configuration using the TableCrafter export tool and import it to another table or another site. This is useful when replicating a table layout across multiple pages or when migrating a table to a staging environment for testing before going live.