Limited Support
Our team is currently on holiday, so support will be limited during this period. Response times may be slower than usual, and some inquiries may be delayed.
We appreciate your patience and understanding, and we’ll resume our usual support by the end of August.
Is there any way to toggle html emails? I don't need registration or other core emails, just post notifications, so I'm not too concerned about filters.
I just want to make the forum emails match my other official emails.
I found the code below in a previous post but it crashed my site, Is there any other way to allow HTML in emails?
function my_custom_email_html_tags( $allowed_html ){
if( $allowed_post_html = wp_kses_allowed_html( 'post' ) ){
$allowed_html = $allowed_post_html
}
return $allowed_html;
}
add_filter( 'wpforo_kses_allowed_html_email', 'my_custom_email_html_tags');
Hi @gunarcom,
I don't follow you well. Currently, wpForo allows sending HTML emails.
If there are some tags that are not allowed you should use the following hook:
add_filter('wpforo_kses_allowed_html_email', 'custom_wpforo_kses_allowed_html_email');
function custom_wpforo_kses_allowed_html_email($allowed_html){
if( !wpfkey($allowed_html, 'h1') ) $allowed_html['h1'] = array();
if( !wpfkey($allowed_html['h1'], 'style') ) $allowed_html['h1']['style'] = array();
if( !wpfkey($allowed_html, 'span') ) $allowed_html['span'] = array();
if( !wpfkey($allowed_html['span'], 'style') ) $allowed_html['span']['style'] = array();
return $allowed_html;
}
Thanks, I guess it was just stripping out most of the email like tables, images, and divs.
I will try adding the tags into your filter. Thanks.