Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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.
/**
* 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