Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fresh sheet and Newsletter being sent to users in inactive organizations #3338

Closed
rbarreca opened this issue Jul 25, 2018 · 1 comment
Closed
Assignees

Comments

@rbarreca
Copy link
Contributor

rbarreca commented Jul 25, 2018

Actual Behavior
The fresh sheet email and newsletter email are still being sent to users whose organizations have yet to be activated or were deactivated intentionally.

Repro 1

  1. Market manager clicks on Market Info tab, unchecks Auto-activate organizations and saves
  2. Unauthenticated user comes to https://demoaccelerate.localorbit.com/users/sign_in, clicks Request an Account and fills out form
  3. User receives confirmation email and clicks Verify email address (then user.confirmed? should be true, but organization.active? false still)
  4. (Note, if user logs in at this point he will see a page not found, which is a separate bug When a newly-registered user clicks Verify Email Address, she is sent to https://app.localorbit.com/users/sign_in if market has auto-activated disabled #3339)
  5. If market manager sends fresh sheet or newsletter at this point, this confirmed-but-inactive user will receive the emails

Repro 2

  1. As market manager, find an existing active organization with a non-suspended user that just belongs to that org
  2. Click Deactivate button
  3. Send a fresh sheet and newsletter
  4. User will receive emails

Expected
We should not send fresh sheet nor newsletter to any users of inactive organizations (organization.active). Remember a user could belong to multiple organizations (one that is inactive, one that is active) so a user should still receive an email if part of an active org and inactive org.

An organization may be inactive due to the following:

  • a user/org has registered, confirmed their email, but is still waiting to be activated by market manager (for markets that have Auto-activate organizations disabled on their Market Info tab)
  • a market manager intentionally deactivated an org by clicking Deactivate on /admin/organizations or /admin/organizations/1234

Notes

  • There was an attempted fix in Lo 808 fix email receiver filter #3284 but it doesn't seem to have resulted in the expected results above. Rob accidentally released the PR 5.0.11 so it didn't get properly tested on staging nor was the issue well defined. These scenarios are working correctly, however:
  • if organization is active but a user has been "suspended" from that organization — by clicking Suspend button on /admin/organizations/1234/users (user_organizations.enabled)
  • if user hasn't confirmed their email address yet (user.confirmed?)

[JIRA Import Details]
Issue URL: https://localorbit.atlassian.net/browse/LO-808
Reporter: Kate Barker
Issue Type: Bug

@rbarreca rbarreca added this to To do in Project Board via automation Jul 25, 2018
@rbarreca rbarreca changed the title Fresh sheet and Newsletter being sent to unactivated accounts Fresh sheet and Newsletter being sent to users in inactive organizations Jul 25, 2018
@ivar ivar added the started development Work has started on this - ask on slack for more info label Jul 30, 2018
@ivar ivar moved this from To do to In progress in Project Board Jul 31, 2018
@ivar ivar removed the started development Work has started on this - ask on slack for more info label Jul 31, 2018
ivar added a commit that referenced this issue Aug 8, 2018
- reworked fresh sheet specs
- added new specs for enabled org statuses
- reworked fresh sheet interactor
@ivar ivar moved this from In progress to Needs review in Project Board Aug 8, 2018
@rbarreca rbarreca moved this from Needs review to Reviewer approved in Project Board Aug 21, 2018
@rbarreca rbarreca moved this from Reviewer approved to Awaiting QA in Project Board Aug 21, 2018
@rbarreca rbarreca moved this from Awaiting QA to QA Accepted in Project Board Oct 15, 2018
@rbarreca
Copy link
Contributor Author

Tested on staging and verified fresh sheet going to active buyer org only, not inactive buyer.

@rbarreca rbarreca added this to the v5.0.12 milestone Oct 15, 2018
@rbarreca rbarreca moved this from QA Accepted to Released in Project Board Oct 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Project Board
  
Released
Development

No branches or pull requests

2 participants