BP_Email_Tokens::token__status_update( BP_Email $bp_email, array $formatted_tokens, array $tokens )

Generate the output for token status_update

Description

Parameters

$bp_email

(Required)

$formatted_tokens

(Required)

$tokens

(Required)

Return

(string) html for the output

Source

File: bp-core/classes/class-bp-email-tokens.php

457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
public function token__status_update( $bp_email, $formatted_tokens, $tokens ) {
    $output = '';
 
    $settings = bp_email_get_appearance_settings();
 
    $activity = isset( $tokens['activity'] ) ? $tokens['activity'] : false;
 
    if ( empty( $activity ) ) {
        return $output;
    }
 
    ob_start();
    ?>
    <table cellspacing="0" cellpadding="0" border="0" width="100%">
        <tr>
            <td align="center">
                <table cellpadding="0" cellspacing="0" border="0" width="100%">
                    <tbody>
                    <tr>
                        <td valign="middle" width="65px" style="vertical-align: middle;">
                            <a style="display: block; width: 47px;" href="<?php echo esc_attr( bp_core_get_user_domain( $activity->user_id ) ); ?>"
                               target="_blank" rel="nofollow">
                                <?php
                                $avatar_url = bp_core_fetch_avatar( array(
                                    'item_id' => $activity->user_id,
                                    'width'   => 100,
                                    'height'  => 100,
                                    'type'    => 'full',
                                    'html'    => false,
                                ) );
                                ?>
                                <img src="<?php echo esc_attr( $avatar_url ); ?>" width="47" height="47"
                                     style="margin:0; padding:0; border:none; display:block; max-width: 47px; border-radius: 50%;"
                                     border="0">
                            </a>
                        </td>
                        <td width="88%" style="vertical-align: middle;">
                            <div style="color: <?php echo esc_attr( $settings['body_secondary_text_color'] ); ?>; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: <?php echo esc_attr( $settings['body_text_size'] . 'px' ); ?>; line-height: <?php echo esc_attr( $settings['body_text_size'] . 'px' ); ?>; letter-spacing: -0.24px;"><?php echo bp_core_get_user_displayname( $activity->user_id ); ?></div>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </td>
        </tr>
 
        <tr>
            <td height="24px" style="font-size: 24px; line-height: 24px;">&nbsp;</td>
        </tr>
 
        <tr>
            <td>
                <table cellspacing="0" cellpadding="0" border="0" width="100%"
                       style="background: <?php echo esc_attr( $settings['quote_bg'] ); ?>; border: 1px solid <?php echo esc_attr( $settings['body_border_color'] ); ?>; border-radius: 4px; border-collapse: separate !important">
                    <tbody>
                    <tr>
                        <td height="5px" style="font-size: 5px; line-height: 5px;">&nbsp;</td>
                    </tr>
                    <tr>
                        <td align="center">
                            <table cellpadding="0" cellspacing="0" border="0" width="88%" style="width: 88%;">
                                <tbody>
                                    <tr>
                                        <td>
                                            <div style="color: <?php echo esc_attr( $settings['body_text_color'] ); ?>; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: <?php echo esc_attr( $settings['body_text_size'] . 'px' ); ?>; letter-spacing: -0.24px; line-height: <?php echo esc_attr( floor( $settings['body_text_size'] * 1.625 ) . 'px' ) ?>;">
                                                <?php echo apply_filters_ref_array( 'bp_get_activity_content_body', array(
                                                    $activity->content,
                                                    &$activity
                                                ) ); ?>
                                            </div>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td height="5px" style="font-size: 5px; line-height: 5px;">&nbsp;</td>
                    </tr>
                    </tbody>
                </table>
            </td>
        </tr>
 
        <tr>
            <td height="24px" style="font-size: 24px; line-height: 24px;">&nbsp;</td>
        </tr>
 
        <tr>
            <td>
                <a href="<?php echo esc_attr( $tokens['mentioned.url'] ); ?>" target="_blank" rel="nofollow"
                   style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; color: <?php echo $settings['highlight_color']; ?>; text-decoration: none; display: block; border: 1px solid <?php echo $settings['highlight_color']; ?>; border-radius: 100px; width: 84px; text-align: center; height: 32px; line-height: 32px;"><?php _e( 'Reply', 'buddyboss' ); ?></a>
            </td>
        </tr>
    </table>
    <div class="spacer" style="font-size: 20px; line-height: 20px; height: 20px;">&nbsp;</div>
    <?php
    $output = str_replace( array( "\r", "\n" ), '', ob_get_clean() );
 
    return $output;
}

Changelog

Changelog
Version Description
BuddyBoss 1.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.