Skip to:
Content
Pages
Categories
Search
Top
Bottom

Email Tokens

  • @debora1976

    Participant

    Hi,

    Is it possible to trim the private message content and bbpres forum topic and forum reply content, to let’s say 15 or 20 words…
    Now the whole message is e-mailed.

    Kind regards,
    Debby

Viewing 5 replies - 1 through 5 (of 5 total)
  • @venutius

    Moderator

    You should ask on the bbPress forums regarding limiting the topic size.

    For private messages and also Activity update size restrictions I’ve just added those restriction capabilities into my plugin https://wordpress.org/plugins/bp-messaging-control/, I’d welcome your feedback, but make it on the plugin forum, this ones only for BuddyPress.

    @venutius

    Moderator

    Ah Debora, I might have not got the full jist of your message, that new setting will restrict the original message length, including the length of the email, but the email will still have that content. Tomorrow I’m going to explore ways of reducing the email content to just the first few words and a link to view the whole message.

    @shanebp

    Moderator

    From the codex…

    This will limit the BuddyPress message content to 50 words.
    Change 50 to whatever integer you want.

    function bp_email_content_length( $formatted_tokens, $tokens, $obj ) {
    	
      $formatted_tokens['usermessage'] = wp_trim_words( $formatted_tokens['usermessage'], 50, '...' );
    	
      return $formatted_tokens;
    	
    }
    add_filter( 'bp_email_set_tokens', 'bp_email_content_length', 10, 3 );

    @vpphapluat

    Participant

    🙂

    @venutius

    Moderator

    Thanks Shanebp, I’ve added this to my plugin

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar