Skip to content

Instantly share code, notes, and snippets.

@ericnicolaas
Created March 7, 2016 12:07
Show Gist options
  • Save ericnicolaas/34145222159f6525f6e5 to your computer and use it in GitHub Desktop.
Save ericnicolaas/34145222159f6525f6e5 to your computer and use it in GitHub Desktop.
Fix a bug where emails are not sent in certain cases in Charitable 1.3.3
function ed_set_correct_email_headers( $headers, $email ) {
$from_address = charitable_get_option( 'email_from_email', get_option('admin_email') );
$headers = "From: {$email->get_from_name()} <{$from_address}>\r\n";
$headers .= "Reply-To: {$from_address}\r\n";
$headers .= "Content-Type: {$email->get_content_type()}; charset=utf-8\r\n";
return $headers;
}
add_filter( 'charitable_email_headers', 'ed_set_correct_email_headers', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment