Notifications
Clear all

wpForo 1.x.x [Solved] Images in System Emails?

7 Posts
2 Users
1 Reactions
1,211 Views
Posts: 56
Topic starter
(@glowball)
Trusted Member
Joined: 7 years ago

I'd like to add a couple images to be sent with emails (such as the email for a new topic reply).  I add the images to the template in Settings -> Emails by using the Add Media button.  Everything looks great and I click Update Options.  Then the images are stripped from the email.  What am I doing wrong?  Thanks!

6 Replies
Sofy
Posts: 4900
 Sofy
Admin
(@sofy)
Support Team
Joined: 7 years ago

Hi @glowball,

Please send the admin login details to info[at]gvectors.com email address. I'll ask developers to check the issue for you. 

Posts: 56
Topic starter
(@glowball)
Trusted Member
Joined: 7 years ago

Hi Sofy, sending my admin credentials via email to a shared inbox seems like a pretty bad idea.  Is there another way?  

It sounds like the images are supposed to stay, which is good to hear.  

4 Replies
Sofy
 Sofy
Admin
(@sofy)
Joined: 7 years ago

Support Team
Posts: 4900

@glowball

let me ask the developers about the issue. I'll update the topic asap. 

(@glowball)
Joined: 7 years ago

Trusted Member
Posts: 56

@sofy Much appreciated, thanks!

Sofy
 Sofy
Admin
(@sofy)
Joined: 7 years ago

Support Team
Posts: 4900

@glowball,

Please try to add the following code in the active theme's functions.php file and check again: 

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, 'img') ) $allowed_html['img'] = array();
if( !wpfkey($allowed_html['img'], 'style') ) $allowed_html['img']['style'] = array();
if( !wpfkey($allowed_html['img'], 'src') ) $allowed_html['img']['src'] = array();
if( !wpfkey($allowed_html['img'], 'width') ) $allowed_html['img']['width'] = array();
if( !wpfkey($allowed_html['img'], 'height') ) $allowed_html['img']['height'] = array();
if( !wpfkey($allowed_html['img'], 'alt') ) $allowed_html['img']['alt'] = array();
return $allowed_html;
}

Please let us know if it doesn't help.

(@glowball)
Joined: 7 years ago

Trusted Member
Posts: 56

@sofy  I added this filter and tried to add an image to the email template, and it stuck.  I think we're good to go -- the filter did the trick.  Thanks so much for your help!!!