Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: How to restrict PM notifications email to excerpt only

@henrywright

Moderator

Hi @pieter

Try this

function filter_private_message_email_body( $email_content, $sender_name, $subject, $content, $message_link, $settings_link, $ud ) {

    $content = substr( $content , 0, 140 );

    $email_content = sprintf( __(
'%1$s sent you a new message:
Subject: %2$s
"%3$s"
To view and read your messages please log in and visit: %4$s
---------------------
', 'buddypress' ), $sender_name, $subject, $content, $message_link );

    return $email_content;
}
add_filter( 'messages_notification_new_message_message', 'filter_private_message_email_body', 10, 7 );

This will make the message 140 characters. Feel free to change the 140 to another number.

Skip to toolbar