Update low balance reminder for new deposit regime
authorAdam Chlipala <adamc@hcoop.net>
Mon, 18 Feb 2008 18:22:48 +0000 (18:22 +0000)
committerAdam Chlipala <adamc@hcoop.net>
Mon, 18 Feb 2008 18:22:48 +0000 (18:22 +0000)
mail.sml
remind/remind.sml

index 4695592..d0e2d27 100644 (file)
--- a/mail.sml
+++ b/mail.sml
@@ -19,4 +19,12 @@ fun mwrite (ses, s) = (TextIO.output (Unix.textOutstreamOf ses, s);
 
 fun mclose ses = Unix.reap ses
 
+(*type session = unit
+
+fun mopen () = ()
+
+fun mwrite ((), s) = print s
+
+fun mclose () = OS.Process.success*)
+
 end
index cbfad89..64afa0c 100644 (file)
@@ -26,18 +26,18 @@ fun main _ =
                val shares = C.intFromSql shares
                val amount = C.realFromSql amount
 
-               val minimum = 900.0 * real shares / real totalShares * 2.0
+               val perMonth = 900.0 * real shares / real totalShares
+               val deposit = perMonth * 3.0
+               val headsUp = perMonth * 5.0
            in
-               if amount >= minimum then
+               if amount >= headsUp then
                    ()
                else
                    let
                        val m = Mail.mopen ()
                        fun write msg = Mail.mwrite (m, msg)
-
-                       val minBal = 900.0 * real shares / real totalShares * 2.0
                    in
-                       if amount < 0.0 then
+                       if amount < deposit then
                            write "Subject: Your NEGATIVE HCoop balance\n"
                        else
                            write "Subject: Your low HCoop balance\n";
@@ -50,30 +50,35 @@ fun main _ =
                        write "\nCc: payment@hcoop.net";
                        write "\n\n";
 
-                       if amount < 0.0 then
+                       if amount < deposit then
                            (write "Your HCoop balance is negative.  This means that you've paid less than you've\n";
-                            write "been charged to date.  Our bylaws allow our board of directors to vote you out\n";
-                            write "of the co-op, without any obligation to contact you first, when your balance\n";
-                            write "stays negative for three months.  Please make a payment as soon as possible, so\n";
-                            write "that we don't need to do this!\n\n")
+                            write "been charged to date, excluding your required deposit.  If your account hasn't\n";
+                            write "been frozen yet, expect that to happen very soon.  Our bylaws allow our board\n";
+                            write "of directors to vote you out of the co-op, without any obligation to contact\n";
+                            write "you first, when your balance stays negative for three months.  Please make a\n";
+                            write "payment as soon as possible, so that we don't need to do this!\n\n")
                        else
-                           (write "Your HCoop balance has dropped below your requested minimum, based on your\n";
-                            write "sliding scale pledge amount.  Please make a payment as soon as you can.\n\n");
+                           (write "With our current dues projections, you have less than two months left until\n";
+                            write "your HCoop balance becomes negative, based on your sliding scale pledge amount.\n";
+                            write "Please make a payment as soon as you can.  We will freeze your account if your\n";
+                            write "balance does become negative, and the board of directors will probably vote you\n";
+                            write "out of the cooperative shortly thereafter if you don't make a payment.\n\n");
 
                        write "Your balance: US$";
-                       write (printReal amount);
+                       write (printReal (amount - deposit));
                        write "\nTotal number of members linked to your balance: ";
                        write (Int.toString members);
                        write "\nTotal pledge amount: ";
                        write (Int.toString shares);
-                       write "\nRequested minimum balance: US$";
-                       write (printReal minBal);
-                       write "\nPayment to get there: US$";
-                       write (printReal (minBal - amount));
+                       write "\nDeposit: US$";
+                       write (printReal deposit);
+                       write "\nMinimum amount to pay to not see this message again for two months: US$";
+                       write (printReal (headsUp - amount));
 
-                       write "\n\nYour minimum was calculated by dividing our total monthly expenses ($900) by the\n";
-                       write "sum of all members' pledge amounts, multiplying by your pledge amount, and then\n";
-                       write "multiplying by 2.  That is, the amount covers your share of two months' expenses.\n\n";
+                       write "\n\nYour deposit requirement was calculated by dividing our total monthly expenses\n";
+                       write "($900) by the sum of all members' pledge amounts, multiplying by your pledge amount,\n";
+                       write "and then multiplying by 3.  That is, the amount covers your share of three months'\n";
+                       write "expenses.\n\n";
 
                        write "To make a payment, visit:\n";
                        write "     https://members.hcoop.net/\n";