How to Get Notifications When a Form Is Submitted in WordPress

Last Updated on November 7, 2024 by Sunny Staff

The WordPress form is one of the most valuable additions to any website. It may not be the most feature-rich or flashy part of your website, but it’s a carrier of new relationships, business growth, and new experiences. However, a form’s value is only realized when you are properly notified of new submissions. While virtually all form plugins have the ability to alert you to new submissions, every now and then you’ll be faced with a scenario where you may need to put in a little extra work to get notifications delivered to the correct destination.

In this post

Custom Notifications – Why You May Need Them
How to Enable Notifications in Popular Form Plugins
Gravity Forms
Elementor
WP Forms
Contact Form 7
functions.php: Plugin-independent form notifications
Best Practices for Form Notifications
FAQ: WordPress Notification
Conclusion

Custom Notifications – Why You May Need Them

Form plugins all have notification capabilities, so why would you need to go the extra mile to add custom notifications? The most obvious answer here is that the notification potential of the form plugin is limited – either in functionality or number (e.g. you can only add one notification per form). Here are a few other reasons:

1. Customizing Notifications to Relevant Team Members

As mentioned above, some plugins come with limitations such as the number of notifications or the number of recipients. Custom notifications can be used to override these limitations. For example, instead of using multiple forms – each with its own notification – custom conditional notifications can be used to send the form to a particular destination depending on the subject.

2. Tailoring the Content of the Notifications

One key benefit of customized notifications is that they can be, well, customized. This means including additional data in the form, as well as formatting the message body of the form, adding branding, and generally ensuring it stands out in the recipient’s inbox.

3. Send Notifications to the User for Confirmation

Since not all plugins allow for multiple notifications, custom notifications can be used to inform the user or visitor that their form was submitted successfully, along with any additional instructions on the next steps to perform.

4. Reducing Noise with Conditional Logic

Not every form submission needs an immediate notification – perhaps you only want to be alerted about certain kinds of leads or queries. Conditional logic notifications can help reduce noise, ensuring that you’re only notified about relevant submissions. This is especially useful in high-volume situations where not every response requires the same level of urgency.

5. Custom Notification Schedules

There may be instances where notifications need to be sent on a schedule. For example, instead of receiving individual emails for each submission, you might want to get a daily or weekly summary of all form submissions to reduce the email clutter. Some advanced configurations can help set up notifications at specific times.

6. Customizing Notifications Based on User Behavior

You may want to adjust notifications based on user behavior—such as different notifications for first-time submissions versus repeat users. This can help you treat loyal customers differently, perhaps by adding personalized thank-you messages or prioritizing their requests.

Also read: Tips to Grow Your WordPress Blog in 2023

How to Enable Notifications in Popular Form Plugins

Gravity Forms

When logged into the WordPress back-end, navigate to Forms > Forms

Click Edit on the form you want to modify. Then navigate to Settings > Notifications.

With Gravity Forms you can create multiple notifications for each form, useful if you have to send out different notifications to different recipients or via several email services or when specific conditions are met. 

To add a new notification click on the Add New button and complete the necessary fields, including the notification name, the appropriate email service (leave on default if unsure), the event that should trigger the notification, and so on. The individual fields themselves are self-explanatory. However, if you are unclear about a field, just click on the small question mark next to the field label.

Bonus: Gravity Forms conditional logic

Want to add some intelligence to your form’s notifications? Check Enable conditional logic. For this example we created a drop-down with four departments: Engineering, Management, Sales, and Support. This allows the form user to determine where their email should go.

Conditional logic can be used to send the notification to the relevant department as you can see here:

Needless to say, this is just an example and the same logic can be applied to other situations, such as:

  • Adding a ‘Department’ dropdown to the form. The notification can then be sent to whichever department is selected in the form (you may need to set up a notification per department).
  • A notification can be fired off whenever a form is submitted with a specific email address. This can make it easier to channel emails from important customers, customers who may require a little more attention, suppliers, and so on, to the right destinations.
  • Notifications can also be sent based on multiple factors, such as email address and words in the message body. This can be useful in a B2B scenario where some users may be testing out a new product.

When you’re done, click the Update Notification button at the bottom of the page.

Elementor

Elementor makes notifications available within its form widget (Elementor Pro required). Once you’ve added the form widget to your page, click on Actions After Submit under Content in the left-hand pane.

Under Add Action click on Email. This adds another tab to the pane called Email

The default for the Email action is to send a notification of the submitted form to the email address of the site administrator. If you want to send this notification to multiple recipients, add additional email addresses to the To field, separating them with commas.

Email2 can be added as a second action that can be used to send additional alerts. Unfortunately, Elementor forms lack the complexity to make features like conditional logic available. But then again, that can also be a good thing.

Also read: 8 Features Your E-commerce Website Needs To Be Successful

WPForms

With 6+ million installs, WPForms is one of the best free WordPress plugins available. It sports an attractive dashboard, and you can add notifications within the form creation wizard. If you want to add notifications to an existing form, you can navigate to WPForms > All Forms and click Edit on your chosen form. Then navigate to Settings > Notifications

The default notification settings send out an alert to the ‘Send To Email Address’, with the visitor’s form submission in the body of the notification.

Note: You can add multiple notifications using conditional logic in WPForms’ Pro version.

Ninja Forms

Ninja Forms makes it super easy to add forms and notifications. From Ninja Forms > Dashboard you can choose a form template (e.g. Contact Us) or start from scratch.

Once you’ve added your form fields, click on the Emails & Actions tab at the top. The list in the left-hand pane shows existing form actions. Click the Add new action link to add additional notifications to your form.

Contact Form 7

With more than 10 million active installations, Contact Form 7 is one of the most popular form plugins in the WordPress ecosystem. While there are other form plugins that are more user-friendly, Contact Form 7 doesn’t take long to master.

You can get started by navigating to the Contact menu item in the WordPress admin panel. You can view existing forms by clicking on Contact Forms, or add a new form by clicking on Add New. Notifications can be created from the form edit page.

Notifications can be configured on the Mail tab – Mail and Mail (2) on the Mail tab are automatic responses that can be sent out whenever a form is submitted. The first Mail is automatically populated with the site admin’s details, which is where form submissions will be sent.

functions.php: Plugin-independent form notifications

Sometimes form plugins fall short in functionality, leaving you unable to set the custom notifications. Below we’ll show you how to hook into the wp_mail function and dispatch a notification every time the wp_mail function is used by WordPress.

Note: Not all forms use the wp_mail function.

Get started by adding the following code to the function.php file in your theme’s directory:

add_filter('wp_mail', 'custom_form_submission_notification');

function custom_form_submission_notification($args) {

// Add custom logic here to identify form submissions.

// Modify email parameters or add more recipients if needed.

$args['to'] .= ', [email protected]'; // Adding another email recipient.

$args['message'] .= "\n\nThis is an additional notification triggered by the custom hook.";

return $args;

}

We can also add conditional logic to the code above to ensure that a notification is only sent when specific conditions are met:

add_filter('wp_mail', 'conditional_form_submission_notification');

function conditional_form_submission_notification($args) {

// Example conditions based on the email content

if (strpos($args['subject'], 'Form Submission') !== false) {

     // Condition 1: Send additional notifications for 'Form Submission' subjects only

     $additional_recipient = '[email protected]';

     // Adding additional recipient conditionally

     if (!empty($args['to'])) {

         $args['to'] .= ', ' . $additional_recipient;

     } else {

         $args['to'] = $additional_recipient;

     }

     // Customize the email content conditionally

     $args['message'] .= "\n\nNote: This is a high-priority form submission.";

}

// Condition 2: Check if a specific keyword is present in the email body

if (strpos($args['message'], 'urgent') !== false) {

     // Add additional recipient if the form is marked as 'urgent'

     $args['to'] .= ', [email protected]';

}

return $args;

}

Here’s what we did above:

  • We check whether the subject of the email being sent contains “Form Submission”. If it does, an additional recipient ([email protected]) is added.
  • Similarly, if the message contains the word “urgent,” another recipient ([email protected]) is added to the list.

Also read: 10 Reasons to Hire WordPress Website Management Services

Best Practices for Form Notifications

Write an attention-grabbing subject line. Good subject lines are short (40 characters or less), personalized, don’t contain spammy words, but do include power words.

Use personalization. Merge tags can be used to address site visitors by their first and last names. When you include details from their submissions, the notification is more tailored and more engaging.

Be clear and concise. The body of your notification email should be simple and straightforward. Communicate the intent of the notification in clear language, and provide any additional information that could be helpful very briefly.

Keep your tone branded. Branding best practices state that it’s always better that all your marketing material (including notification emails) use the same voice, tone, and, where necessary, style.

Make it visually appealing. You probably won’t lose any points if your notifications are plain and to the point. But a nice little graphic can go a long way to help you stand out from the crowd.

FAQ: WordPress Notification

Here are some FAQs you can include in the post to address common questions users might have:

What are the default notification settings in most WordPress form plugins?

Most WordPress form plugins like WPForms, Contact Form 7, and Gravity Forms come with a default setting that sends an email to the site administrator whenever a form is submitted. This can easily be changed – usually in the form settings, else in the plugin settings.

Why aren’t my form notifications being delivered?

This can be due to a number of different reasons, including server configuration issues, domain issues, and so on. Using an SMTP plugin can help improve email deliverability by properly authenticating outgoing emails.

Tip: Check whether your form plugin provides the required functionality to configure additional SMTP senders.

How can I send notifications to different team members based on form input?

You can use conditional logic (available in plugins like Gravity Forms and WPForms Pro) to send notifications to different recipients depending on form field choices, such as department selection.

Can I send a confirmation email to users after they submit a form?

Yes, many plugins allow you to configure multiple notifications, including confirmation emails to users to let them know their submission was received.

What’s the benefit of using SMTP for form notifications?

SMTP helps ensure that notifications are reliably delivered by authenticating outgoing emails, which reduces the chances of messages ending up in spam folders.

Conclusion

Effective form notifications in WordPress are key to maximizing the value of form submissions. Customizing your notifications beyond the default settings can greatly enhance how you respond to leads, keep your team informed, and ensure timely follow-ups. Whether it’s customizing who gets notified, using conditional logic, or improving deliverability through SMTP, putting in a little extra work can significantly improve how you manage submissions.

Already a Sunny HQ customer? Ask us to create form notifications that simplify workflows and boost your productivity. Not a Sunny HQ customer? Choose your plan here.