I can’t seem to get the disable notification filter to work When someone signs up for our newsletter on our website, the first add their email to a form at the bottom of the right sidebar. Upon submission, they are redirected to a second form that collects more information.
I would prefer to receive notifications only from the second form. So I added the following to our functions file:
// Disable notification for Newsletter Step 1
add_filter( ‘gform_disable_notification_17’, ‘disable_notification’, 10, 4 );
The ID of the first form is 17. According to the docs, this should have turned off the admin notification. The filter isn’t working because I am still getting them. What am I doing wrong?
You’ll want this…
add_filter( 'gform_disable_notification_17', '__return_false', 10, 4 );
disable_notification on that line is calling a function that returns
Thanks Joshua. Shame on Gravity Forms for not including that detail in their documentation.
So much for the ‘__return_false’ parameter. We just received a new newsletter signup and the newsletter step one notification again appeared in my inbox. The disable notification filter appears to have done nothing.
Has anyone else used this filter successfully?
There could be another filter override your changes. Try the same filter, but with a high priority, so that it runs after any others that might be hooked in. See if this makes any difference.
add_filter( 'gform_disable_notification_17', '__return_false', 999, 4 );
Thanks, I’ve updated the code. I’ll see if it works.