Skip to:
Content

BuddyPress.org

Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#6913 closed defect (bug) (fixed)

BP_Email_Recipient::get_name() does not necessarly get the name for activation emails

Reported by: imath's profile imath Owned by: djpaul's profile djpaul
Milestone: 2.5 Priority: normal
Severity: normal Version:
Component: Core Keywords: has-patch
Cc:

Description

When the user is not created yet: for sure on multisite and i think when BP_SIGNUPS_SKIP_USER_CREATION is set to true for regular configs. The salutation used in the activation email looks like "Hi ,".

We could probably try to fetch the field_1 signup meta or simply avoid the white space by using a simple "Hi," :)

Attachments (1)

6913.patch (6.6 KB) - added by imath 9 years ago.

Download all attachments as: .zip

Change History (6)

#1 follow-up: @DJPaul
9 years ago

Per discussion in #6896, when we create a template function for the salutation, we can handle this there.

#2 in reply to: ↑ 1 @imath
9 years ago

  • Keywords has-patch added

Replying to DJPaul:

Per discussion in #6896, when we create a template function for the salutation, we can handle this there.

That's what i thought too, but then just to be 100% sure i've built a specific unit test. It appears when BP_SIGNUPS_SKIP_USER_CREATION is true as the user is not created, bp_core_signup_send_validation_email() will fail sending the email.

Then i thought how to deal with an empty {{recipient.name}} or remove the extra space between 'hi' and ',' when we cannot check if {{recipient.name}} is empty as it's a replacement token...

So after digging in BP_Email_Recipient, i think i've found a way to use the user login as the {{recipient.name}} for signups when no user is created.

6913.patch is fixing the 2 issues, although i'm not sure we can use the unit test as i'm defining BP_SIGNUPS_SKIP_USER_CREATION to true, it's there just to illustrate the problem.

@imath
9 years ago

#3 @DJPaul
9 years ago

You're right that we can't use unit tests that set a constant, but your patch looks like a good idea

#4 @djpaul
9 years ago

  • Owner set to djpaul
  • Resolution set to fixed
  • Status changed from new to closed

In 10597:

Emails: for user/site registrations emails, set recipient name to their user_login.

For multisite and for BP_SIGNUPS_SKIP_USER_CREATION , when the user account isn't created yet, we can't fetch the user's display name. Instead, use their user_login name in the email greeting.

Fixes #6913

Props imath

#5 @DJPaul
8 years ago

  • Component changed from API to Core
Note: See TracTickets for help on using tickets.