1 structure Remind
:> REMIND
=
10 val db
= C
.conn dbstring
12 fun getEmail
[name
] = C
.stringFromSql name ^ emailSuffix
13 | getEmail row
= raise Fail
"remind getName"
15 val names
= C
.map db getEmail
"SELECT WebUserActive.name FROM WebUserActive JOIN Balance ON Balance.name = WebUserActive.name AND bal = Balance.id WHERE amount < 10"
19 Mail
.mwrite (m
, "Subject: Reminder of low HCoop balance\n");
20 Mail
.mwrite (m
, "From: HCoop Portal <payment");
21 Mail
.mwrite (m
, emailSuffix
);
22 Mail
.mwrite (m
, ">\n");
23 Mail
.mwrite (m
, "Bcc: ");
24 Mail
.mwrite (m
, String.concatWith
"," names
);
25 Mail
.mwrite (m
, "\n\n");
26 Mail
.mwrite (m
, "This is a friendly reminder that your monetary balance at HCoop has dropped below\n");
27 Mail
.mwrite (m
, "the US$10 \"deposit\" amount. You can check your balance at:\n");
28 Mail
.mwrite (m
, "\t");
29 Mail
.mwrite (m
, urlPrefix
);
30 Mail
.mwrite (m
, "money\n\n");
31 Mail
.mwrite (m
, "You'll also see on that page a link you can follow to pay via PayPal.\n\n");
32 Mail
.mwrite (m
, "It would be great if you could bring your balance above that amount soon.\n");
33 Mail
.mwrite (m
, "More information on how to pay can be found at:\n");
34 Mail
.mwrite (m
, "\thttp://wiki.hcoop.net/wiki/MemberDues\n");