Opened 10 years ago
Last modified 9 years ago
#2720 new defect (bug)
Can't filter email notification per user
Reported by: | alexander.rohmann | Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | |
Component: | API - Subscriptions | Keywords: | |
Cc: | jjjay@… |
Description
Take a look here: https://bbpress.trac.wordpress.org/browser/trunk/src/includes/common/functions.php#L1278
$message = apply_filters( 'bbp_forum_subscription_mail_message', $message, $topic_id, $forum_id, $user_id );
$subject = apply_filters( 'bbp_forum_subscription_mail_title', '[' . $blog_name . '] ' . $topic_title, $topic_id, $forum_id, $user_id );
At that point, $user_id hasn't been set yet, so you can't access it inside the filter. It also triggers an "Undefined Variable" notice
Attachments (1)
Change History (5)
Note: See
TracTickets for help on using
tickets.
Hi - in bbPress 2.5.4, the email notifications went from sending each email notification individually to a subscriber to bcc'ing all subscribers into one email. So you can't use that filter with $user_id. It shouldn't be in there, but I have a feeling it was simply overlooked. Attached is a patch (my first one, it might be wrong... we'll see, I suppose). The patch, if it works, won't allow you to use $user_id, it just takes it out.
However, if you do need to customise the emails for each user, you can make your own notify subscribers functions. bbPress 2.5.3 has subscriptions sent individually so when I needed to do it, I started from the functions in there.