Description
Use this filter to change the notification email format (text or html).
Usage
<?php
add_filter("gform_notification_format", "set_format", 10, 4);
?>
You can also target a specific form by adding the form id after the hook name.
<?php
add_filter("gform_notification_format_6", "set_format", 10, 4);
?>
Parameters
$format
- (string) The format to be filtered. Possible values are "text" and "html".
$notification_type
- (string) The type of notification this applies to. Possible values are "user" (for user notifications) or "admin" (for admin notifications).
$form
- (Form Object) Current Form object
$entry
- (Entry Object) Current Entry object
Examples
This example sets admin notifications to be sent in Text format and user notifications to be sent in HTML format.
<?php
add_action("gform_notification_format", "set_notification_format", 10, 4);
function set_notification_format($format, $notification_type, $form, $lead){
if($notification_type == "admin")
return "text"; //setting admin notifications as text
else
return "html"; //setting user notifications as text
}
?>
Source Code
This filter is located in common.php