five-for-the-future
five-for-the-future copied to clipboard
Remove contributor hours when account banned
When an account is banned, we could automatically remove their contributor hours/teams/company data. That would immediately clear them off team roster and help team reps find active folks easier, and it'd prevent them getting the "inactivity" emails later on.
remove_contributor()
could be called for company-sponsored folks, and reset_contribution_data()
directly for self-sponsored folks.
Alternatively we could just prevent the emails from being sent to them, and let the future automated deletion process from #169 remove them.
Quick Question: What if an account is banned temporarily? What happens in that case? All the access and data from their profile will be removed? Just a thought came to my mind, that banned might happen in any misunderstanding case and later on, the account could get recovered by any chance.
That's a good question. I think most bans are permanent, but in a case where one isn't it should be easy to re-enter the hours/teams. The rest of their profile data would still be in tact.
There's definitely a trade-off there, but it seems better to me than having inaccurate data, or adding more complexity to account for the status of accounts, etc. What do you think?
Yes, AGree with your point. let's not make it complex, the complex one may confuse the user, whom to include and whom to ignore. The temporary ban is once in a while, we can handle them manually. If the account user will reach out in case of lost data, we can request them for cooperation.
Another approach would be to reset the hours when they're about to be sent an inactivity email (#27), instead of immediately. That'd give folks some time to resolve temporary bans, and it'd also make this apply retroactively to folks who have already been banned.
AFAIK The emails shouldn't go out, as I believe we block outgoing emails to banned accounts.
Due to how we ban accounts, and how a permanent ban is the same as a temporary ban, calling the remove_*()
functions isn't ideal, most particularly as the 5ftf code isn't loaded on those requests most likely.
Perhaps, the company details / available people list, should just be re-calculated regularly and accounts that are marked as unavailable (ie. banned) get skipped during that process.
Are you referring to the pre_wp_mail
callback in mu-plugins/mail.php
? That short-circuits emails to blocked domains, rather than bbp_blocked
users.
Extending that to also short-circuit mail to bbp_blocked
users might be a good idea, though, since it'd avoid having to add restrictions to everything that sends mail. I wonder if there are any cases where we would want to send mail to a blocked user, though? 🤔
2880d80e12c7c4440ce06d41d7cd25e6388e9243 stopped the emails, but didn't delete the hours/teams data or anything else.