• Resolved obito7621

    (@obito7621)


    Hi Chad,
    After doing a lot of digging i was finally able to retain style tag in the email body by adding this function in my functions.php file

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

    Now when saving to database it removes all the style which have single quotes, example style=”background-color: red;” this would work but style=’background-color: red;’ is removed completely when saving to database. I installed another plugin which lets me modify emails and when i put my custom email there it works perfectly fine.
    Please suggest a way i can send my custom email without having to change my HTML.

Viewing 1 replies (of 1 total)
  • Thread Starter obito7621

    (@obito7621)

    All you need to do is just remove wp_kses function (class-wp-members-admin-api.php -> line 232 ) when the plugin is saving the data to the database and now you are all set to use all HTML email in the body without worrying if any tag will be removed.

    • This reply was modified 7 years, 4 months ago by obito7621.
Viewing 1 replies (of 1 total)

The topic ‘style tags in emails’ is closed to new replies.