Enable Multi-Part Message Format

It looks as though it is best practice to include a text/plain version of the message to help with deliverability but I’m not seeing where to enable multipart format. The only documentation for Gravity Forms that mentions multipart is here: https://docs.gravityforms.com/gform_notification/#4-change-the-message-format

Does Gravity Forms allow multipart to be enabled to help with spam filters?

This is not currently a feature of the Gravity Forms notifications, but it is on our list of requested features to add that capability. I will add your vote. Thank you.

1 Like

Can you add me to that vote count?

I’m stuck on an API build because the multipart support in WordPress is essentially nonexistent and the API rejects all of my requests. Sigh.

2 Likes

Will do. Another vote added.

We were able to come up with a code snippet using examples from this Gravity Forms page: https://docs.gravityforms.com/gform_notification/

When running https://www.mail-tester.com/ it seems to have solved the problem.

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 Text Notification

	GFCommon::log_debug( 'gform_notification: format changed to multipart.' );
	// Change notification format to multipart from the default html
	$notification['message_format'] = 'multipart';

	return $notification;
}
1 Like