Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save MrImranJaved/dccc833448fb5d9411b5f62d5b09aa35 to your computer and use it in GitHub Desktop.
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.
/**
* 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