Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to inject styling into private message? messages_new_message function


  • simmidhaliwal
    Participant

    @simmidhaliwal

    I created an action that uses the messages_new_message function (any time a user gets a tag, they automatically receive a private message.)

    Would it be possible to put a border around the message or make the font different? I would like to make these messages stand out a little from the other messages in a users inbox/thread by adding some styling. Below is the code I am using:

    function send_message_to_student_113( $user_id, $tags_applied ) {
    
    $tag_id = wp_fusion()->user->get_tag_id( ‘course tag 1.1.1’ );
    
    if ( in_array( $tag_id, $tags_applied ) ) {
    
    $args = array(
    ‘sender_id’ => 1,
    ‘thread_id’ => false,
    ‘recipients’ => $user_id,
    ‘subject’ => ‘Hello there’,
    ‘content’ => ‘You got a new tag! Congratulations. Please let me know if you need any help!’,
    ‘date_sent’ => bp_core_current_time()
    );
    
    $result = messages_new_message( $args );
    
    }
    }
    add_action( ‘wpf_tags_applied’, ‘send_message_to_student_113’, 10, 2 );

    I am using WordPress 5.3 and I am actually using BuddyBoss which is a fork of Buddypress.

    Thank you! Simmi

  • You must be logged in to reply to this topic.
Skip to toolbar