How to Automatically Email a Table Export as an Attachment

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, Excel, or PDF 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/PDF, 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.
- Pro TableCrafter Pro activated on your WordPress site, the export and email alert features are Pro-only.
- A configured table pulling data from Gravity Forms, Google Sheets, REST API, Airtable, or WooCommerce. If you have not built a table yet, go to TableCrafter → Tables → Add New and walk through the table builder first.
- A working WordPress mail setup. Most hosts either configure
wp_mail()by default or you will need an SMTP plugin such as WP Mail SMTP. Send a test email from Settings → General or your SMTP plugin's diagnostic tool before continuing.
wp_mail() so they respect whatever mail transport your site already uses, including transactional providers like SendGrid, Mailgun, or Postmark.How Does Step 1, Enable Export on Your Table Work?
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:
csv, plain comma-separated values, compatible with every spreadsheet applicationexcel,.xlsxformat with column headers preservedpdf, formatted for print or archival; respects column visibility settings
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.
How Does Step 2, Configure the Email Alert Work?
Still inside the table builder, click the Email Alerts tab. This panel controls when TableCrafter sends notifications and what those notifications contain.
The key settings for an attachment workflow are:
- Recipients, comma-separated list of email addresses. These can be static addresses, or you can enter
{admin_email}to pull the address from Settings → General. - Subject, supports dynamic tokens:
{table_name},{date},{entry_count}. Example:Daily Report: {table_name} — {date}. - Attach Export, toggle this on. A format selector appears letting you choose CSV, Excel, or PDF for the attachment specifically. This can differ from what you enabled in the Export tab for front-end download buttons.
- Trigger, see the next section for trigger options.
The email body is a rich-text field. You can write a plain summary, paste a table of key metrics, or leave it short and let the attachment carry the detail. Recipients do not need to log in to WordPress to access the data, it arrives as a standard email attachment.
What Is Step 3, Choose a Trigger: Scheduled vs. Event-Based?
TableCrafter Pro supports two families of triggers for email alerts:
Scheduled (Time-Based)
Under Trigger → Schedule, set a recurring interval:
Daily , sends once per day at a configured time (UTC)
Weekly , sends on a chosen day of the week
Monthly, sends on the 1st of each month
Scheduled exports run on WordPress Cron (wp-cron.php). On high-traffic sites this fires reliably. On low-traffic sites, you should set up a true server cron to hit https://yoursite.com/wp-cron.php at the scheduled time so the trigger does not slip by hours waiting for a visitor to load a page.
Event-Based
Under Trigger → On Change, the alert fires when:
- A new entry is added to the connected Gravity Form
- An existing entry is edited via inline editing in the table
- A bulk action (delete, column-fill) is applied to one or more rows
Event-based triggers are ideal for audit trails, for example, emailing a manager every time a driver updates a load record. The attachment in this case is a snapshot of the full table at the moment of the change, not just the changed row.
How Does Step 4, Test Before Going Live Work?
Save your table settings. You will see a Send Test Email button at the bottom of the Email Alerts panel. Clicking it fires the alert immediately using the current table data, regardless of the trigger condition, and delivers it to the first address in your Recipients field.
Check the following when the test email arrives:
- The attachment opens correctly in your spreadsheet application and contains the expected columns and rows.
- Column headers match what you expect, TableCrafter uses the label you set in the column builder, not the Gravity Forms field key.
- Any lookup fields (ID-to-label resolution) are resolved in the export. For example, a user ID column should show the display name, not the raw integer, if you configured a lookup field for it.
- Date fields use your configured format. TableCrafter respects the date display format set per column; the export inherits the same format.
- Row count in the attachment reflects your active filters. If you applied persistent filters on the table (for example, showing only entries from the last 30 days), the export includes only the filtered rows, not the full dataset.
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:
- Create a separate table per region with an Advanced Filter applied locking the
regionfield to the relevant value. - Configure a scheduled email alert on each table pointing to the appropriate manager's address.
- 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. The shortcodes [tablecrafter id="X"], [tablecrafter id="X"], and [tablecrafter id="X"] all map to the same handler, use whichever you prefer.
Frequently Asked Questions
How Does Step 1, Enable Export on Your Table Work?
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 and PDF, 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 and PDF, 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.