Add custom columns to Flamingo Inbound Messages table

In this Contact Form 7 tutorial, you will learn how to add your own custom table columns into the Flamingo Inbound Messages table using two WordPress hooks.

There are 4 default columns in the Inbound Messages table (Subject, From, Channel and Date).

The Flamingo plugin helps to store the Contact Form 7 submissions into the WordPress database. You will be able to view all the form submissions in the Flamingo > Inbound Messages page.

Add a “Company” and “Category” column

Let’s assume that your contact form has a text field to collect the visitor’s company name and a dropdown menu of a list of categories as shown in the screenshot below.

Now you want to display both the “Company” and “Category” columns in the Flamingo Inbound Messages table.

  1. Login to your WordPress Admin.
  2. Browse to Contact > Contact Forms.
  3. Edit your Form.
  4. Note the “company” field name highlighted in red.
  5. Note the “category” field name highlighted in red.
  6. Copy and paste PHP code below into your theme’s functions.php file.
Contact Form 7 - Form Editor
Contact Form 7 – Form Editor

PHP Code

The following code fits this tutorial scenario. If you want to change the columns to match the fields from your forms, then you need to edit the PHP code. You do need basic understanding of PHP.

In Line 9 and 10, change the “company” and “category” array keys and labels to suit your form fields names.

In Line 22 to 29, change the switch case statement to suit your form field names

Results

Here is a screenshot of two custom columns added into the Flamingo’s Inbound Messages table.

Inbound Messages - Custom Columns
Inbound Messages – Custom Columns

Did you know that you can also capture the UTM parameters of your Contact Forms 7 submissions and then tabulate the UTM parameters into Flamingo? By capturing the UTM parameters, you will know which marketing campaign brought in that lead. Check out our article here.