Email Template - Ne...
 
Notifications
Clear all

[Solved] Email Template - New Topic Notification-Font Size is not saved

3 Posts
2 Users
0 Reactions
1,666 Views
Posts: 5
Topic starter
(@steffeng)
Active Member
Joined: 2 years ago

Set font size disappears after "Safe Option".

Examble Set Font Size 16 bevor saving

<p style="font-family: arial;"><span style="font-size: 16px;">Hallo [user_display_name],</span></p><p><span style="font-size: 16px;">in Ihrem abonnierten Fachthema wurde ein neues Thema erstellt.</span></p>

after saving

<p style="font-family: arial;">Hallo [user_display_name],</p><p>in Ihrem abonnierten Fachthema wurde ein neues Thema erstellt.</p>

So need a little help 😉

2 Replies
Chris
Posts: 3627
(@chris)
Famed Member
Joined: 3 years ago

Hi @steffeng,

Emails are filtered for HTML codes. The <span> tag is not allowed in email content as it is not a Post content. It should be secure and clean. This will help emails to pass more antispam systems of Email servers.

The default WordPress emails doesn't have HTML tags, we added a few secure tags (formatting tags and link).

By default, allowed tags are: 'a', 'img', 'blockquote', 'h1-h5','hr', 'br',  'p', 'style', 'strong'.

However, you can use the below code to allow all tags to work.

Put this code in your active theme functions.php file:

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');

How to Easily Add Custom Code in WordPress (without Breaking Your Site)

Posts: 5
Topic starter
(@steffeng)
Active Member
Joined: 2 years ago

perfect...thanks 🍾