gravityflow_notification

Allows the emails to be filtered before they're sent.

/**
 * Set the the notification from address and from name to the current user when the current step is approval and the email is an approval or rejection email.
 *
 * @param array $notification
 * @param array $form
 * @param array $entry
 * @param Gravity_Flow_Step $step
 *
 * @return array
 */
function sh_gravityflow_notification( $notification, $form, $entry, $step ) {
    if ( step->get_type() == 'approval' && $step->get_status() !== 'pending' ) {
        $current_user = wp_get_current_user();
        $notification['from']     = $current_user->user_email;
        $notification['fromName'] = $current_user->display_name;
        $notification['subject'] = $current_user->display_name;
	
	// Custom subject
	$notification['subject']  = 'New Status: ' . $status;

	// Uncomment these lines to disable autoformatting
	//$notification['disableAutoformat']  = '1';
	//$notification['message_format']  = 'text';
    }
    return $notification;
}
add_filter( 'gravityflow_notification', 'sh_gravityflow_notification', 10, 4 );

Placement

This code should be placed in the functions.php file of your active theme.

Still need help? Contact Support Contact Support