Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter steveindzine

    (@steveindzine)

    Another issue I have with using HTML is that style tags are stripped out and the CSS is left so gets displayed in the email. Is there a filter I can use to change this?

    Thread Starter steveindzine

    (@steveindzine)

    Just found this from another post:

    add_filter(‘wp_kses_allowed_html’, ‘my_allowed_tags’);
    function my_allowed_tags($tags) {
    $tags[‘style’] = array( ‘type’ => true, );
    return $tags;
    }

    So my only issue is making emails be HTML just for new registrations, not for admin notification. So I found this: https://rocketgeek.com/plugins/wp-members/docs/filter-hooks/wpmem_email_headers/ but can’t work out how to use $toggle.

    Thread Starter steveindzine

    (@steveindzine)

    I figured it out:

    add_filter( ‘wpmem_email_headers’, ‘my_wpmem_html_email’, 10 , 2 );
    function my_wpmem_html_email($default_headers, $toggle) {
    if($toggle == ‘newreg’) {
    $default_headers = “Content-Type: text/html” . “\r\n”;
    }

    return $default_headers;
    }

    Seems to be working for me.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘HTML Formated Email’ is closed to new replies.