Skip to:
Content

BuddyPress.org

Opened 9 years ago

Closed 9 years ago

#6873 closed regression (fixed)

Group notification email updates for bp_send_email() compatibility

Reported by: dcavins's profile dcavins Owned by:
Milestone: 2.5 Priority: high
Severity: blocker Version:
Component: Groups Keywords: has-patch
Cc: dcavins

Description

In the class BP_Email_Recipient, the recipient argument is checked strictly for is_int(). However, many of the user_ids returned by group functions are numeric strings, so BP_Email_Recipient fails.

Following is a list of the affected emails:

  • email groups-details-updated in groups_notification_group_updated(). Recipient user_ids are provided by BP_Groups_Member::get_group_member_ids( $group->id ) which returns those ids as numeric strings.
  • email groups-membership-request in groups_notification_new_membership_request(). Recipient user_ids are provided by groups_get_group_admins( $group_id ) which returns those ids as numeric strings.
  • emails groups-membership-request-accepted and groups-membership-request-rejected in groups_notification_membership_request_completed(). Recipient user_ids are provided by BP_Groups_Member->user_id which returns user_ids as numeric strings.
  • emails groups-member-promoted in groups_notification_promoted_member(). Recipient user_id is grabbed from an action variable, so is a string.
  • email groups-invitation in groups_notification_group_invites(). Recipient user_ids are provided by BP_Groups_Member->user_id which returns user_ids as numeric strings.

Additionally, there are a couple of token mismatches in the groups-invitation email.

Attachments (2)

6873-user-ids.patch (2.2 KB) - added by dcavins 9 years ago.
Send user IDs as integers, not numeric strings.
6873-tokens.patch (1.3 KB) - added by dcavins 9 years ago.
Fix token mismatches in group notification emails.

Download all attachments as: .zip

Change History (6)

#1 @DJPaul
9 years ago

Good catches. Thanks for testing. As discussed on Slack, when you have a patch ready, feel free to commit!

@dcavins
9 years ago

Send user IDs as integers, not numeric strings.

@dcavins
9 years ago

Fix token mismatches in group notification emails.

#2 @dcavins
9 years ago

In 10509:

BP Email: Cast user ID as integer in group emails.

Make sure that user IDs that are numeric strings
are cast as integers for compatibility with
bp_send_email().

See #6873.

#3 @dcavins
9 years ago

In 10510:

BP Email: Fix group email token mismatches.

Make sure that the token names sent to
bp_send_email() match the tokens used in the
email content template.

See #6873.

#4 @dcavins
9 years ago

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.