Title: not working with gravityforms
Last modified: August 20, 2016

---

# not working with gravityforms

 *  Resolved [davidsky](https://wordpress.org/support/users/davidsky/)
 * (@davidsky)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/not-working-with-gravityforms/)
 * Wp better emails is not working with notifications sent by gravityforms.
 * Any solution ?
 * Best Regards,
    D.
 * [http://wordpress.org/extend/plugins/wp-better-emails/](http://wordpress.org/extend/plugins/wp-better-emails/)

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Plugin Author [Nicolas Lemoine](https://wordpress.org/support/users/nlemoine/)
 * (@nlemoine)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/not-working-with-gravityforms/#post-3592637)
 * Hi davidsky,
 * This is because gravityforms already sends the emails as “text/html”. The emails
   must be “text/plain” to be wrapped by the HTML template.
 *  [Damian](https://wordpress.org/support/users/timersys/)
 * (@timersys)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/not-working-with-gravityforms/#post-3592679)
 * Add in to your functions.php the following:
 *     ```
       add_filter('gform_notification_format','gf_email_format');
       function gf_email_format(){
       	return 'text/plain';
       }
       ```
   
 *  [Damian](https://wordpress.org/support/users/timersys/)
 * (@timersys)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/not-working-with-gravityforms/#post-3592680)
 * nlemoine, maybe you can add that filter in the future to avoid problems. Thanks
   for the great plugin!
 *  Plugin Author [Nicolas Lemoine](https://wordpress.org/support/users/nlemoine/)
 * (@nlemoine)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/not-working-with-gravityforms/#post-3592681)
 * Hi timersys,
 * Unfortunately, I can’t add that kind of filter because the notfications of gravity
   forms may contain HTML that could mess with the email template. The probably 
   should add an option whether to send text or HTML emails, like many plugins do.
 *  [Damian](https://wordpress.org/support/users/timersys/)
 * (@timersys)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/not-working-with-gravityforms/#post-3592682)
 * Fair enough. In my case it worked but my notifications don’t contain any Html
 * Thanks anyway
 *  [whiteweazel21](https://wordpress.org/support/users/whiteweazel21/)
 * (@whiteweazel21)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/not-working-with-gravityforms/#post-3592696)
 * Does this still work? I added the function to my child theme’s php, but still
   getting default e-mails.
 * Thanks
 *  [Simon Foxe](https://wordpress.org/support/users/sfoxe/)
 * (@sfoxe)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/not-working-with-gravityforms/#post-3592701)
 * [@whiteweazel21](https://wordpress.org/support/users/whiteweazel21/) – I also
   find this is broken, even with the filter in place. I’ve tried setting the Gravity
   Forms email format to either “text” (as per their updated documentation) or “
   text/plain” (as per above), but no dice.
 * Manually editing line #432 of wpbe.php to True gets it working properly, but 
   the formatting of the content is now wrong. There are additional carriage returns
   and spacing around the content.
 * I think this is the best plugin for this functionality, except Gravity Forms 
   not working is a deal breaker. I’ll be using WP Email Template plugin in the 
   meantime until this is resolved.
 *  Plugin Author [Nicolas Lemoine](https://wordpress.org/support/users/nlemoine/)
 * (@nlemoine)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/not-working-with-gravityforms/#post-3592702)
 * Hi,
 * Just digged into the gravity forms documentation and found this :
    [http://www.gravityhelp.com/documentation/page/Gform_notification](http://www.gravityhelp.com/documentation/page/Gform_notification)
 * Look at example 4. I tested it and everything looks ok.
 * Short answer for lazy people, paste this in your theme functions.php file :
 *     ```
       add_filter('gform_notification', 'change_notification_format', 10, 3);
       function change_notification_format( $notification, $form, $entry ) {
   
           // change notification format to text from the default html
           $notification['message_format'] = "text";
   
           return $notification;
       }
       ```
   
 *  [Simon Foxe](https://wordpress.org/support/users/sfoxe/)
 * (@sfoxe)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/not-working-with-gravityforms/#post-3592703)
 * Nice work. How about extending that a bit further so it only does it if WP Better
   Emails is activated, as well as forcing Disable AutoFormat so the output doesn’t
   have double linebreaks.
 *     ```
       add_filter('gform_notification', 'change_notification_format', 10, 3);
       function change_notification_format( $notification, $form, $entry ) {
       	if (class_exists('WP_Better_Emails')) {
       		// change notification format to text from the default html
           	$notification['message_format'] = "text";
       		// Disable auto formatting so you don't get double line breaks
       		$notification['disableAutoformat'] = true;
       	}
           return $notification;
       }
       ```
   
 *  Plugin Author [Nicolas Lemoine](https://wordpress.org/support/users/nlemoine/)
 * (@nlemoine)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/not-working-with-gravityforms/#post-3592704)
 * Checking if the class exists is a little bit different from the plugin being 
   active. You should use `is_plugin_active`.
 *     ```
       add_filter('gform_notification', 'change_notification_format', 10, 3);
       function change_notification_format( $notification, $form, $entry ) {
   
       	// is_plugin_active is not availble on front end
       	if( !is_admin() )
       		include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
       	// does WP Better Emails exists and activated ?
       	if( !is_plugin_active('wp-better-emails/wpbe.php') )
       		return $notification;
   
       	// change notification format to text from the default html
           $notification['message_format'] = "text";
       	// disable auto formatting so you don't get double line breaks
       	$notification['disableAutoformat'] = true;
   
           return $notification;
       }
       ```
   

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘not working with gravityforms’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-better-emails_f6f6f6.svg)
 * [WP Better Emails](https://wordpress.org/plugins/wp-better-emails/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-better-emails/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-better-emails/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-better-emails/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-better-emails/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-better-emails/reviews/)

 * 10 replies
 * 5 participants
 * Last reply from: [Nicolas Lemoine](https://wordpress.org/support/users/nlemoine/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/not-working-with-gravityforms/#post-3592704)
 * Status: resolved