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 - Notify admins of users approaching/over storage limit #1189

Closed
9 tasks
adamalton opened this issue Mar 30, 2022 · 1 comment
Closed
9 tasks
Assignees
Labels
kind/enhancement A net-new feature or improvement to an existing feature need/triage Needs initial labeling and prioritization P2 Medium: Good to have, but can wait until someone steps up pi/account-limits topic/pot Issues handled by PT.

Comments

@adamalton
Copy link
Contributor

adamalton commented Mar 30, 2022

This is a an extension of #990, and depends on #1153, which is part of that.

We want to notify the Web3.Storage admins of the users who are approaching or over their storage limit.

  • We should do this as part of the checkStorageUsed function that's been added in Storage limit - Framework to get users and record emails sent #990.
  • We only want to tell admins about users who have exceeded their storage quota (over 100%), we don't need to tell them about the other users.
  • We should exclude any users whose accounts are restricted, as the admins don't need to worry about these. This has been done as Exclude restricted accounts from quota usage notification emails #1194
  • Rather than send the admins a separate email for each individual user who has exceeded their limit, we should send a single email with a list of all the users who have exceeded their limit.
  • For this we will use the template_content parameter to insert a block of content into a MailChimp template. See API docs.
  • We should use the EmailService to send these emails.
  • The admins probably don't want to receive this email more than once a day, so we could make use of the daysSince parameter of EmailService.sendEmail to ensure that admins don't get it more than once a day, even if we start running the cron job more frequently than that.
    • Note that for this we will want to set the daysSince to less than one day, because the cron job might be run daily but won't necessarily run on an exact schedule, so we probably want to set it to something like 23 hours. So we might want to change daysSince to hoursSince! NOTE: implemented as secondsSinceLastSent
  • We'll need to create a new email type AdminStorageExceeded and a new template in MailChimp (and then use the "Send to Mandrill" option so that we can send it transactionally).
  • We should probably call sendEmail with just the list of user details in templateVars parameter, and then leave it up to the MailChimpEmailProvider to decide how it wants to format that list into the template.
@adamalton adamalton added kind/enhancement A net-new feature or improvement to an existing feature need/triage Needs initial labeling and prioritization labels Mar 30, 2022
@mbommerez mbommerez changed the title feat: notify admins of users approaching/over storage limit Storage limit - Notify admins of users approaching/over storage limit Apr 1, 2022
@dchoi27
Copy link
Contributor

dchoi27 commented Apr 4, 2022

@mbommerez FYI labeled this pi/account-limits

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/triage Needs initial labeling and prioritization P2 Medium: Good to have, but can wait until someone steps up pi/account-limits topic/pot Issues handled by PT.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants