Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Filter email message content

  • @bazel

    Participant

    I’m trying to filter new message email content. I need to change only the first line “%1$s sent you a new message” but I receive the content, subject and the link empty. Do I have to add values for them in the filter also and I if I have to how can I get them

    function change_bp_new_message_email_content($email_content) {
    
    return sprintf( __('You have one new message', 'buddypress' ), $sender_name, $subject, $content, $message_link ). "\n" .sprintf( __('Subject:%1$s', 'buddypress' ),$subject). "\n" .sprintf( __('Content: %1$s', 'buddypress' ),$content). "\n\n" .sprintf( __('To view and read the message please login on this link: %1$s', 'buddypress' ), $message_link);
    }
    add_filter('messages_notification_new_message_message', 'change_bp_new_message_email_content');

    Please help. Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • @shanebp

    Moderator

    Try this:

    function change_bp_new_message_email_content($email_content, $sender_name, $subject, $content, $message_link, $settings_link) {
    
    	$email_content = sprintf( __(
    	'You have one new message:
    	Subject: %1$s
    	"%2$s"
    	To view and read your messages please log in and visit: %3$s
    	---------------------
    	', 'buddypress' ), $subject, $content, $message_link );
    	
    	return $email_content;
    
    }
    add_filter('messages_notification_new_message_message', 'change_bp_new_message_email_content', 1,  6);

    @bazel

    Participant

    Works good. Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Filter email message content’ is closed to new replies.
Skip to toolbar