Skip to:
Content

BuddyPress.org

Opened 5 months ago

Closed 5 months ago

Last modified 5 months ago

#9206 closed defect (bug) (fixed)

Duplicate Activation Email Sent When Using Invite Registration Feature

Reported by: vapvarun's profile vapvarun Owned by: imath's profile imath
Milestone: 14.0.0 Priority: normal
Severity: normal Version:
Component: Registration Keywords: has-patch reporter-feedback
Cc: emaralive

Description

When using the invite registration feature, a member invites a user to join the website via email. The invited user receives an email with the subject line "user has invited you to join [sitename]." Upon clicking the link in the email to complete their registration, their account is activated immediately. However, once this process is complete, the invited user also receives a separate activation email containing a link that, when clicked, indicates that their account is already active. This duplicate activation email should not be sent.

This issue confuses new users who receive duplicate activation emails after activating their accounts. Preventing the duplicate email will streamline the user registration experience.

Attachments (3)

image (10).png (306.1 KB) - added by vapvarun 5 months ago.
invite email already contain user activation flow
mailpit-invitations.png (53.3 KB) - added by dcavins 5 months ago.
Mailpit inbox after two invitations, one in BP 12.5.1 and one in BP 14-b2
9206.1.diff (1.7 KB) - added by dcavins 5 months ago.
Resolves duplicate email when accepting invite while requests are active.

Download all attachments as: .zip

Change History (13)

@vapvarun
5 months ago

invite email already contain user activation flow

This ticket was mentioned in Slack in #buddypress by imath. View the logs.


5 months ago

#2 @imath
5 months ago

  • Milestone changed from Awaiting Review to 14.0.0

#4 @dcavins
5 months ago

Using vanilla BP 12.5.1 I get the following workflow:
Existing user invites new user to site.
New user gets email with "accept your invitation" link.
Following link takes user to registration form.
User fills out registration form.
Upon completion, new user sees the Account Activated! screen.
Site admin receives "New User Registration" email.
New user receives "Welcome!" email.

Using BP Beta Tester plugin to use 14-b2
Flow is the same as 12.5.1.

This is the expected workflow, as far as I understand it to be. Varun, do you have some other plugins activated? Are you using single site or network setup?

Edit: It was fun to watch your test video, I use the exact same Local + Mailpit setup for testing and it's awesome. I'll attach a photo of the Mailpit inbox after I invited a new user in 12.5.1 and 14.

Last edited 5 months ago by dcavins (previous) (diff)

@dcavins
5 months ago

Mailpit inbox after two invitations, one in BP 12.5.1 and one in BP 14-b2

#5 @emaralive
5 months ago

  • Cc emaralive added

@dcavins
5 months ago

Resolves duplicate email when accepting invite while requests are active.

#6 @dcavins
5 months ago

So the primary issue is that invitations are not really accepted until the bp_core_signup_user hook, and that happens after apply_filters( 'bp_core_signup_send_activation_key'... in bp_core_signup_user().

However, there are some interactions that still need to be thought through. For instance, if you are allowing membership requests and invitations, then, if a request has been made, extending an invitation to that same user should accept the request, which is not currently happening. When both are active, we need to check the following cases:

  • invitation only path
  • request only path
  • invitation followed by request (this should ignore the invitation if the user simply comes to * the request membership form without following the invitation link)
  • request followed by invitation (this should result in the user being activated)

I can look at the last issue on Friday, but I don't have any more time today. We've got to celebrate Independence Day here in the US. :)

#7 @imath
5 months ago

  • Keywords has-patch reporter-feedback added

Thanks a lot for work on the issue and for your patch @dcavins 😍, happy Independence day 🗽.

I think we can wait for 15.0 for the site memberships/invitations improvements. Most important to me was to fix the duplicate email.

@vapvarun can you check it's also fixing the issue for you? I'll commit @dcavins 's patch once you confirmed.

#8 @vapvarun
5 months ago

Thanks @dcavins patch is working perfectly, Happy Independence Day 🗽.
https://prnt.sc/-81ir2UDC0xt ( no extra email for account activation after the invitation is accepted )
https://www.loom.com/share/e131c2882b9c49a6b1542dda1aed4405

#9 @imath
5 months ago

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

In 13945:

Site invitations: avoid duplicate activation emails

Props dcavins, vapvarun, emaralive

Fixes #9206

#10 @dcavins
5 months ago

Thanks for testing!

Note: See TracTickets for help on using tickets.