gform_format_email_to

Description

The gform_format_email_to filter can be used to allow for formatting of the TO email address to improve spam score.

Usage

add_filter( 'gform_format_email_to', 'your_function_name' );

Parameters

Defaults to false. Set to true using the WordPress __return_true function or a custom function that returns true.

Example

By default, emails sent from Gravity Forms have a to address formatted as [to] => samuel@example.com. The following example will return true for this filter in order to format the address as [to] => "samuel@example.com" <samuel@example.com>.

add_filter( 'gform_format_email_to', '__return_true' );

Placement

This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.

See also the PHP section in this article: Where Do I Put This Code?

Since

This filter was added in Gravity Forms version 2.2.0.3.

Source Code

This filter is located in GFCommon::send_email() in common.php.