New member madness\!
authoradamch <adamch>
Sat, 1 Oct 2005 15:36:59 +0000 (15:36 +0000)
committeradamch <adamch>
Sat, 1 Oct 2005 15:36:59 +0000 (15:36 +0000)
app.sml
app/app.sml
app/confirm.mlt
poll.mlt
util.sig
util.sml
welcome.txt [new file with mode: 0644]

diff --git a/app.sml b/app.sml
index aec4e35..d018983 100644 (file)
--- a/app.sml
+++ b/app.sml
@@ -102,13 +102,10 @@ fun approve (app, msg) =
 
        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
index 84ca130..8ac969e 100644 (file)
@@ -154,7 +154,7 @@ fun confirm (id, passwd) =
        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: ");
index 74f583f..b0e0187 100644 (file)
@@ -1,4 +1,4 @@
-<% @header [("title", ["Confirm appliaction"])];
+<% @header [("title", ["Confirm application"])];
 
 val id = Web.stoi ($"id");
 val passwd = $"p";
index 9cc9c60..b216a4f 100644 (file)
--- a/poll.mlt
+++ b/poll.mlt
@@ -285,7 +285,6 @@ end %>
 <% end %>
 </table>
 
-<a href="poll?report=<% id %>">Vote Report</a>
 <% else
 foreach cho in Poll.listChoices id do %>
        <li> <% Web.html (#descr cho) %>
@@ -297,6 +296,8 @@ foreach cho in Poll.listChoices id do %>
 <% end
 end %>
 
+<a href="poll?report=<% id %>">Vote Report</a>
+
 <% if canModify then %>
 <br><hr><br>
 <h3><b>Add a new choice</b></h3>
index 9be363b..46a86b1 100644 (file)
--- a/util.sig
+++ b/util.sig
@@ -24,4 +24,6 @@ sig
     val randomPassword : unit -> string
 
     val domainDir : string -> string
+
+    val readFile : string -> string
 end
index d5c68d5..801044e 100644 (file)
--- a/util.sml
+++ b/util.sml
@@ -65,4 +65,17 @@ fun randomPassword () = Int.toString (Int.abs (Random.randInt (!rnd)))
 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
diff --git a/welcome.txt b/welcome.txt
new file mode 100644 (file)
index 0000000..47aa515
--- /dev/null
@@ -0,0 +1,9 @@
+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.