Selectively Send Gravity Forms Notifications in Plain Text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Send Gravity Form notifications in plain text when Notification is called `Plain Text Notification` | |
add_filter( 'gform_notification', 'change_notification_format', 10, 3 ); | |
function change_notification_format( $notification, $form, $entry ) { | |
GFCommon::log_debug( 'gform_notification: change_notification_format() running.' ); | |
// Do the thing only for a notification with the name `Plain Text Notification` | |
if ( $notification['name'] == 'Plain Text Notification' ) { | |
GFCommon::log_debug( 'gform_notification: format changed to text.' ); | |
// Change notification format to text from the default html | |
$notification['message_format'] = 'text'; | |
} | |
return $notification; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment