hcb icon indicating copy to clipboard operation
hcb copied to clipboard

[Spending Limit] Add warning email when balance is getting low

Open garyhtou opened this issue 1 year ago • 4 comments

Send an email to the user when their spending limit is getting low. Something along the lines of:

hi, your Hack Club HQ spending controls balance is getting low. Your current balance is $23.

To top up your balance, please ask your manager to create an allowance here (link to their spending control page).

I'm not exactly sure what the threshold should be.

garyhtou avatar Nov 01 '24 00:11 garyhtou

10% of maximum balance?

sampoder avatar Nov 01 '24 00:11 sampoder

"max balance" as in calculate the running balance and then get the maximum of those values?

yeah, that can work. I'd suggest

historic_max_balance_cents = # as described above
threshold = [historic_max_balance_cents, 25_00].max

garyhtou avatar Nov 01 '24 05:11 garyhtou

"max balance" as in calculate the running balance and then get the maximum of those values?

yep

sampoder avatar Nov 03 '24 09:11 sampoder

Cool!!

historic_max_balance_cents = # as described above
threshold = [historic_max_balance_cents, 25_00].max

Let's go with this!

garyhtou avatar Nov 07 '24 00:11 garyhtou