Skip to content

Instantly share code, notes, and snippets.

@vfontjr
Created April 29, 2020 15:57
Show Gist options
  • Save vfontjr/0ca1b51d9ee0045f61f297a16324dbea to your computer and use it in GitHub Desktop.
Save vfontjr/0ca1b51d9ee0045f61f297a16324dbea to your computer and use it in GitHub Desktop.
<?php
add_filter( 'wp_mail_content_type', 'set_content_type' );
function set_content_type( $content_type ) {
return 'text/x-gm-impdata';
}
<?php
add_filter('frm_pre_create_entry', 'adjust_my_email_header');
function adjust_my_email_header($values){
if ( $values['form_key'] == 'contact2' ) {
add_filter('frm_email_header', 'change_email_content_type');
}
return $values;
}
function change_email_content_type($header) {
/* remove the Content Type element of the array */
array_pop($header);
/* needed to preserve compatibility */
$charset = get_option('blog_charset');
$content_type = 'Content-Type: text/x-gm-impdata; charset="' . esc_attr( $charset ) . '"';
$header[] = $content_type;
return $header;
}
<?php
add_filter('frm_email_header', 'change_formidable_email_content_type');
function change_formidable_email_content_type($header) {
/* remove the Content Type element of the array (the last element) */
array_pop($header);
/* needed to preserve compatibility */
$charset = get_option('blog_charset');
$content_type = 'Content-Type: text/x-gm-impdata; charset="' . esc_attr( $charset ) . '"';
$header[] = $content_type;
return $header;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment