Send email reports of contact form inbox entries, including possible spam. Requires Contact Form 7 and Flamingo plugins! This is free software as-is with absolutely no warranty! Feel free to contribute on GitHub to report problems and add missing features!
As a non-tech-savvy WordPress website owner, I need to receive regular reports about inbound messages, including possible spam, to make sure that I don't miss a single lead from potential customers.
Putting it more technically,
receive = send emails or other notifications
regular = using a scheduler like wp-cron
reports = output a human-readable list
about inbound messages = query Flamingo database
Converting my technical requirements into code, and adding some non-functional WordPress specifics like if (is_admin()) { to prevent interfering with the blog frontend in any way, we add a schedule entry using add_filter( 'cron_schedules' calling a function that verifies our requirements before querying the message database, formatting a list and sending a message to the default admin recipient using the default email mechanism.
We can split cron, mail, and report, and create a plugin page to display a report and possible error messages, using a custom query loop over existing Flamingo posts and their property names guessed from inspecting their list view's source code or URLs.
What are the most important requirements?
Putting it more technically,
Converting my technical requirements into code, and adding some non-functional WordPress specifics like
if (is_admin()) {
to prevent interfering with the blog frontend in any way, we add a schedule entry usingadd_filter( 'cron_schedules'
calling a function that verifies our requirements before querying the message database, formatting a list and sending a message to the default admin recipient using the default email mechanism.We can split cron, mail, and report, and create a plugin page to display a report and possible error messages, using a custom query loop over existing Flamingo posts and their property names guessed from inspecting their list view's source code or URLs.
Having a look a these URLS
/wp-admin/admin.php?page=flamingo_inbound&orderby=from&order=asc
/wp-admin/admin.php?page=flamingo_inbound&orderby=subject&order=asc
/wp-admin/admin.php?page=flamingo_inbound&orderby=date&order=desc
/wp-admin/admin.php?page=flamingo_inbound&post_status=spam
I assume that there is a custom post type
flamingo_inbound
that has the following propertiesfrom
subject
date
post_status
with a possiblespam
value.