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

Storage limit - Framework to get users and record emails sent #990

Closed
LeslieOA opened this issue Feb 16, 2022 · 2 comments
Closed

Storage limit - Framework to get users and record emails sent #990

LeslieOA opened this issue Feb 16, 2022 · 2 comments
Assignees
Labels
kind/enhancement A net-new feature or improvement to an existing feature need/approach P3 Low: Not priority right now pi/account-limits topic/pot Issues handled by PT.

Comments

@LeslieOA
Copy link
Contributor

LeslieOA commented Feb 16, 2022

Overarching user needs:

  • Users need to receive warning emails from about nearing (milestones) their storage quota or exceeding it. User gets an email notification from support@web3.storage when they’ve hit the following thresholds: 75%, 80%, 85%, 90%, with instructions on how to request more.
  • Admins (support@web3.storage) need to receive an email when a user has gone over their allowed storage quota.

Notion - Enforcing-user-storage-capacity-limits

We can compare a users default (1TiB) or increased (user_tag table, tag of STORAGE_LIMIT_BYTES) storage quota to what their current used storage.

Tasks

  1. DB function to retrieve all users with storage used with a percentage from/to range of their allocated storage quota
    User details returned:
  • Email
  • First and last name
  • Storage quota
  • Storage used
  1. DB function to save details of sent email
  • User ID
  • Email type
  • Email message ID
  • Sent at
  1. Node function in the cron package to call the DB functions to get the users that need emailing and save details of email sent.

  2. Send the email with MailChimp. This is split out into a sub-ticket: Storage limit - Add MailChimp email service #1153


Threshold milestones and email frequency (TBC):

  • Weekly email: equal to or greater than 75% of storage quota used (but below 85%)
  • Weekly email: equal to or greater than 85% of storage quota used (but below 95%)
  • Daily email: equal to or greater than 90% of storage quota used

Note: This quota includes both uploads via the web UI and pins via the PSA (Pinning Service API).

A cron job every {daily} (at a minimum).

MailChimp's API is the preferred method of email automation.

Questions

Do we need a storage_usage_exceeded table (as a snapshot of users who are over their quota) or will querying on cron and upload/pin suffice?

CC @dchoi27 for email frequency.

@LeslieOA LeslieOA added kind/enhancement A net-new feature or improvement to an existing feature P1 High: Likely tackled by core team if no one steps up need/triage Needs initial labeling and prioritization need/approach topic/pot Issues handled by PT. labels Feb 16, 2022
@LeslieOA LeslieOA changed the title Email user when their storage quota when nearing or exceeding their storage quota Email user when their storage quota is nearing or exceeding their storage quota Feb 17, 2022
@LeslieOA LeslieOA changed the title Email user when their storage quota is nearing or exceeding their storage quota Email user when their storage quota is nearing or exceeding their storage limit Feb 17, 2022
@LeslieOA LeslieOA changed the title Email user when their storage quota is nearing or exceeding their storage limit Email user with their storage quota when nearing or exceeding their storage quota Feb 17, 2022
@LeslieOA LeslieOA changed the title Email user with their storage quota when nearing or exceeding their storage quota Notify user with their storage quota when nearing or exceeding their storage quota Feb 17, 2022
@dchoi27
Copy link
Contributor

dchoi27 commented Feb 17, 2022

SGTM - I'd say crank it up to daily at 90% (and replace the last 2 bullets)

@dchoi27 dchoi27 removed the need/triage Needs initial labeling and prioritization label Feb 18, 2022
@GaryHomewood GaryHomewood self-assigned this Feb 25, 2022
@mbommerez mbommerez changed the title Notify user with their storage quota when nearing or exceeding their storage quota Notify users & support when nearing or exceeding their storage quota Mar 4, 2022
@mbommerez mbommerez added P3 Low: Not priority right now and removed P1 High: Likely tackled by core team if no one steps up labels Mar 7, 2022
@mbommerez mbommerez changed the title Notify users & support when nearing or exceeding their storage quota Storage limit - Framework to get users and record emails sent Mar 23, 2022
@adamalton adamalton changed the title Storage limit - Framework to get users and record emails sent Storage limit - Framework to email users and record emails sent May 11, 2022
@adamalton adamalton changed the title Storage limit - Framework to email users and record emails sent Storage limit - Framework to get users and record emails sent May 11, 2022
@adamalton
Copy link
Contributor

I'm re-opening this, because #1273 is marked as fixing this, so as that is not yet closed, it makes sense for this to still be open. (Although it's slightly confusing, as both #1156 and #1273 are both marked as fixing this!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature need/approach P3 Low: Not priority right now pi/account-limits topic/pot Issues handled by PT.
Projects
None yet
Development

No branches or pull requests

6 participants