Making WordPress.org

Changeset 10158


Ignore:
Timestamp:
08/13/2020 02:13:16 AM (4 years ago)
Author:
dd32
Message:

Support Forum: Add a "you can't reply to this email" note to topic subscription notifications.

Fixes #3730.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-hooks.php

    r10000 r10158  
    125125        add_filter( 'bbp_get_topic_freshness_link', array( $this, 'bbp_get_topic_freshness_link' ), 10, 5 );
    126126
     127        // Add a no-reply-to-email suggestion to topic subscription emails
     128        add_filter( 'bbp_subscription_mail_message', array( $this, 'bbp_subscription_mail_message'), 5, 3 );
    127129    }
    128130
     
    11981200        );
    11991201    }
     1202
     1203    /**
     1204     * Filter the topic subscription message to
     1205     */
     1206    public function bbp_subscription_mail_message( $message, $reply_id, $topic_id ) {
     1207        $reply_author_name = bbp_get_reply_author_display_name( $reply_id );
     1208
     1209        remove_all_filters( 'bbp_get_reply_content' );
     1210
     1211        // Strip tags from text and set up message body.
     1212        $reply_content = strip_tags( bbp_get_reply_content( $reply_id ) );
     1213        $reply_url = bbp_get_reply_url( $reply_id );
     1214
     1215        $message = sprintf( __( '%1$s wrote:
     1216
     1217%2$s
     1218
     1219Post Link: %3$s
     1220-----------
     1221You are receiving this email because you subscribed to a forum topic.
     1222
     1223Log in and visit the topic to reply to the topic or unsubscribe from these emails. Note that replying to this email has no effect.', 'wporg-forums' ),
     1224                $reply_author_name,
     1225                $reply_content,
     1226                $reply_url
     1227        );
     1228
     1229        return $message;
     1230    }
    12001231}
Note: See TracChangeset for help on using the changeset viewer.