• Resolved alanjs90

    (@alanjs90)


    Hi,

    This plugin is great and been very helpful. I was just wondering if there is a list of available tags that can be used in the email? I’m trying to get the topic posters avatar to appear in the html email if possible?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author useStrict

    (@usestrict)

    Hi @alanjs90,

    Thanks for reaching out. You’ll find the list of supported tags beneath the Editor field in bbpnns > Settings > Topics tab and bbpnns > Settings > Replies tab. You’ll find [topic-author] and [topic-author-url] among them.

    There are also filters to add new tags if you need them.

    Cheers,
    Vinny

    Thread Starter alanjs90

    (@alanjs90)

    Thanks.

    Do you know how to add a tag to display the reply authors display picture in emails? I don’t think I saw a tag for that on there list of available tags.

    Plugin Author useStrict

    (@usestrict)

    Hi @alanjs90,

    Avatar tags aren’t supported by default by bbpnns. I might actually add support for it in a future release, though.

    However, in the meantime, you can include the following code to your functions.php and use the tag [my_author_avatar].

    
    add_filter( 'bbpnns_available_topic_tags', 'my_register_bbpnns_avatar_support', 11, 1);
    add_filter( 'bbpnns_available_reply_tags', 'my_register_bbpnns_avatar_support', 11, 1 );
    add_filter( 'bbpnns_filter_email_body_for_user', 'my_bbpnns_avatar_support', 11, 5 );
    
    function my_register_bbpnns_avatar_support( $tags='' )
    {
        $my_tags = '[my_author_avatar]';
        
        return $tags . $my_tags;
    }
    
    function my_bbpnns_avatar_support( $body, $user_info, $type, $post_id, $forum_id )
    {
        if ( false === strpos( $body, '[my_author_avatar]' ) )
        {
            return $body;
        }
        
        $avatar = 'topic' === $type ? bbp_get_topic_author_avatar( $post_id, $size = 40 ) : bbp_get_reply_author_avatar( $post_id, $size = 40 );
        
        $body = str_replace( '[my_author_avatar]', $avatar, $body );
      
        return $body;
    }
    

    Cheers,
    Vinny

    Thread Starter alanjs90

    (@alanjs90)

    Excellent, works perfect thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Available html tags in email notifications’ is closed to new replies.