Skip to:
Content

bbPress.org

Opened 10 years ago

Last modified 9 years ago

#2720 new defect (bug)

Can't filter email notification per user

Reported by: alexanderrohmann's profile 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)

2720.patch (886 bytes) - added by tharsheblows 10 years ago.

Download all attachments as: .zip

Change History (5)

#1 @tharsheblows
10 years ago

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.

@tharsheblows
10 years ago

#2 @tharsheblows
10 years ago

  • Cc jjjay@… added

#3 @netweb
10 years ago

Related: #2618 and the user_id notice was fixed in #2620

#4 @thebrandonallen
9 years ago

  • Component changed from General to API - Subscriptions
  • Milestone changed from Awaiting Review to Future Release

Moving this to future release, so we can tackle this with async notifications.

Note: See TracTickets for help on using tickets.