val mail = Mail.mopen ()
in
- Mail.mwrite (mail, "From: Hcoop Application System <join");
- Mail.mwrite (mail, emailSuffix);
- Mail.mwrite (mail, ">\nTo: ");
+ Mail.mwrite (mail, "To: ");
Mail.mwrite (mail, #email entry);
- Mail.mwrite (mail, "\nCc: ");
- Mail.mwrite (mail, boardEmail);
- Mail.mwrite (mail, "\nSubject: Application approved\n\nYour application for membership has been approved! Welcome to hcoop!\n\n");
+ Mail.mwrite (mail, "\n");
+ Mail.mwrite (mail, Util.readFile "/home/hcoop/portal/welcome.txt");
Mail.mwrite (mail, msg);
OS.Process.isSuccess (Mail.mclose mail)
end
case C.oneOrNoRows db ($`SELECT id FROM MemberApp WHERE id = ^(C.intToSql id) AND passwd = ^(C.stringToSql passwd) AND status = 0`) of
SOME _ =>
(C.dml db ($`UPDATE MemberApp SET status = 1, confirmed = CURRENT_TIMESTAMP WHERE id = ^(C.intToSql id)`);
- sendMail ("board.fake@hcoop.net",
+ sendMail ("board@hcoop.net",
"New membership application",
"We've received a new request to join hcoop.",
fn mwrite => (mwrite ("Open applications: ");
-<% @header [("title", ["Confirm appliaction"])];
+<% @header [("title", ["Confirm application"])];
val id = Web.stoi ($"id");
val passwd = $"p";
<% end %>
</table>
-<a href="poll?report=<% id %>">Vote Report</a>
<% else
foreach cho in Poll.listChoices id do %>
<li> <% Web.html (#descr cho) %>
<% end
end %>
+<a href="poll?report=<% id %>">Vote Report</a>
+
<% if canModify then %>
<br><hr><br>
<h3><b>Add a new choice</b></h3>
val randomPassword : unit -> string
val domainDir : string -> string
+
+ val readFile : string -> string
end
fun domainDir dom =
String.concatWith "/" ("/etc/domains" :: String.fields (fn ch => ch = #".") dom)
+fun readFile fname =
+ let
+ val inf = TextIO.openIn fname
+
+ fun readLines lines =
+ case TextIO.inputLine inf of
+ NONE => String.concat (List.rev lines)
+ | SOME line => readLines (line :: lines)
+ in
+ readLines []
+ before TextIO.closeIn inf
+ end
+
end
--- /dev/null
+Subject: Welcome to HCoop!
+From: HCoop Board of Directors <board@hcoop.net>
+
+The HCoop Board of Directors has voted to accept your membership application. Welcome to our family! :-)
+
+You should now read this wiki page, which describes how we can complete your joining process:
+ http://wiki.hcoop.net/wiki/NewMember
+
+It's a good idea to read it all the way through and then follow the instructions on payment and account creation.