Bricks Weekly Submission Reports
A lightweight WordPress plugin that reads Bricks Builder's native saved form submissions, creates CSV reports, and emails them through WordPress.
by Faraz The Web Guy · github.com/farazahmed84/bricks-weekly-submission-reports
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/farazahmed84/bricks-weekly-submission-reports/archive/refs/heads/main.zipA lightweight WordPress plugin that reads Bricks Builder's native saved form submissions, creates CSV reports, and emails them through WordPress.
The plugin does not replace Bricks forms, duplicate submission storage, or delete submissions.
Requirements
- WordPress 6.0 or newer.
- PHP 7.4 or newer.
- Bricks Builder forms with Save submissions enabled.
- A working WordPress mail configuration.
Installation
- Copy the
bricks-weekly-submission-reportsdirectory intowp-content/plugins/. - Activate Bricks Weekly Submission Reports in WordPress.
- Open Bricks Reports > Settings.
- Enter the recipients and choose the weekly weekday and time.
- Save the settings.
Forms are discovered automatically from the existing {$wpdb->prefix}bricks_form_submissions table. Scheduled reports include every discovered form. Where possible, the plugin uses Bricks form settings to display form names and field labels. It falls back to form and field IDs when those settings are unavailable.
Neither the Settings page nor the Manual Report page contains a form selector. Both report modes process all discovered Bricks forms.
Default scheduled email text:
Subject: Weekly Bricks Form Submissions Report
Message: Attached are the weekly CSV exports containing new submissions from all Bricks forms.
Scheduled reports
The plugin uses a self-rearming weekly WP-Cron event calculated in the WordPress site's configured timezone. This preserves the selected local weekday and time across daylight-saving changes. WP-Cron is traffic-driven, so a report may run after its configured time when the site receives no requests near that time.
Delayed execution does not lose submissions. Each discovered form has its own checkpoint containing the highest successfully exported numeric submission ID. A scheduled report selects IDs greater than each form's checkpoint and attaches one CSV per form.
The checkpoint advances only after WordPress accepts the email through wp_mail(). It does not advance when CSV generation or email submission fails. A true return value from wp_mail() means WordPress accepted the message for delivery; it does not guarantee arrival in the recipient's inbox.
Manual reports
Open Bricks Reports > Manual Report to:
- Choose an inclusive start and end date.
- Enter one or more comma-separated recipients.
- Click Generate and Send Report.
Manual date inputs use the WordPress timezone. Manual reports include every discovered Bricks form in the selected period and attach one CSV per form. They do not read or update the scheduled checkpoints, so they are safe for testing and historical exports.
CSV behavior
- CSVs are UTF-8 with a byte-order mark for Excel compatibility.
- Every form receives its own CSV attachment.
- Attachment filenames follow
{form-name}-{form-id}-submissions-{start-date}-to-{end-date}.csv. - Temporary files are renamed to their final
.csvbasenames before being passed towp_mail(), so recipients do not receive.tmpattachments. - Each CSV begins with
Submission IDandSubmitted At. - The remaining columns are the union of fields encountered in the report.
- Bricks field labels are used when available; otherwise field IDs are retained.
- Missing fields remain blank.
- Arrays use
|as a readable separator. - File fields contain URLs, filenames, or attachment references rather than embedded files.
- Temporary CSV files are deleted immediately after
wp_mail()finishes.
Empty reports
Empty scheduled emails are disabled by default.
- When disabled, forms with no new submissions are omitted from the scheduled email. If every form is empty, no email is sent.
- When enabled, every discovered form receives an attachment, including an empty CSV for forms with no new submissions.
Manual reports are unaffected by this setting and include one CSV per discovered form for the selected date range, including empty CSVs.
Troubleshooting
- If the status panel reports no discovered forms or checkpoints, confirm Bricks has saved submissions and that the submissions table exists.
- If names or labels show IDs, confirm the related Bricks page/template content is available and Bricks is active.
- If emails are not delivered, test the site's general
wp_mail()configuration or use a local mail catcher. This plugin does not provide SMTP settings. - If an attachment has a
.tmpextension, verify the currentclass-csv-generator.phpis deployed and clear any opcode cache before retesting. - The Settings page shows the next run, last successful run, every form's checkpoint, and the latest safe error message.
Data removal
Deactivating the plugin removes its scheduled event but keeps settings and checkpoints. Deleting the plugin through WordPress runs uninstall.php and removes only this plugin's options, lock, status, checkpoints, and scheduled hook. Bricks submissions are never changed or deleted.