Forked from DevinWalker/gravity-forms-strip-email-from-name-quotes.php
Last active
February 1, 2022 14:15
-
-
Save MrImranJaved/dccc833448fb5d9411b5f62d5b09aa35 to your computer and use it in GitHub Desktop.
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
/** | |
* Remove back ticks 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