Notifications
Clear all

wpForo 1.x.x [Solved] How to reduce first 100 characters of reply's content in email notifications.

4 Posts
3 Users
0 Likes
1,066 Views
JorgeW
Posts: 105
Topic starter
(@jorgew)
Estimable Member
Joined: 5 years ago

Hi Support,

When there is a reply to any topic, wpForo sends to subscribed users an email notification.

This email includes the link to the topic, to the reply and the first 100 characters of the body contents of  the reply.

I need to reduce this intro to the reply's content to only the first 50 characters, how can I do that?

Thanks.

3 Replies
Sofy
Posts: 4233
 Sofy
Admin
(@sofy)
Support Team
Joined: 6 years ago

Hi @jorgew,

I'll ask developers and let you know if it's possible. 

Robert
Posts: 10499
Admin
(@robert)
Support Team
Joined: 8 years ago

Hi @jorgew,

There is a filter hook to change the post body length in emails:

'wpforo_email_notification_post_body_length'

 

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

function wpforo_custom_post_body_lenght( $post_body_lenght ){
$post_body_lenght = 50;
return $post_body_lenght;
}
add_filter('wpforo_email_notification_post_body_length', 'wpforo_custom_post_body_lenght', 10);

Read this article to do it correctly:

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

 

1 Reply
JorgeW
(@jorgew)
Joined: 5 years ago

Estimable Member
Posts: 105

Thanks @robert

Exactly what I needed. Works perfectly!!