For some odd reason Gravity Forms includes quotes in the "From" sender name. This is inconsistent with other mail senders so this removes the quotes in the "From Name" email headers.
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
/** | |
* Replace Quotes in Gravity Forms Email Headers | |
* | |
* For some odd reason Gravity Forms includes quotes in the "From" sender name. This is inconsistent with other mail senders so this removes the quotes. | |
* | |
* @param $email | |
* @param $message_format | |
* @param $notification | |
* | |
* @return mixed | |
*/ | |
function givewp_filter_gravityforms_quotes( $email, $message_format, $notification ) { | |
$email['headers']['From'] = str_replace('"', "", $email['headers']['From']); | |
return $email; | |
}; | |
add_filter( 'gform_pre_send_email', 'givewp_filter_gravityforms_quotes', 10, 3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment