More thorough inclusion of the page bug. This should mean the page bug appears just...
[cocanwiki.git] / scripts / mailing_list_send.ml
index 5974e13..35c50d2 100644 (file)
@@ -1,7 +1,7 @@
 (* COCANWIKI - a wiki written in Objective CAML.
  * Written by Richard W.M. Jones <rich@merjis.com>.
  * Copyright (C) 2004 Merjis Ltd.
- * $Id: mailing_list_send.ml,v 1.4 2004/10/04 15:19:56 rich Exp $
+ * $Id: mailing_list_send.ml,v 1.6 2005/11/24 14:54:12 rich Exp $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -37,7 +37,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ =
 
   if email = "" then (
     error ~title:"No email address" ~back_button:true
-      q "You must give an email address.";
+      dbh hostid q "You must give an email address.";
     return ()
   );
 
@@ -57,7 +57,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ =
 
   if registered then (
     error ~title:"Email address already used" ~back_button:true
-      q
+      dbh hostid q
       ("That email address is already on our mailing list. "^
        "If you are not receiving mailing list messages, then you will " ^
        "need to confirm that address. If you continue to have problems " ^
@@ -87,14 +87,15 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ =
 
   let body = template#to_string in
   let subject = "Site notice: " ^ hostname ^ ": Confirm your email address" in
-  Sendmail.send_mail ~subject ~body ~to_addr:[email] ();
+  Sendmail.send_mail ~subject ~to_addr:[email] body;
 
   (* Finish up. *)
   let buttons = [ ok_button "/" ] in
   ok ~buttons ~title:"Confirmation email sent"
-    q ("Please check your email now.  You have been sent a confirmation " ^
-       "email so we can verify the email address is yours.  Click on the " ^
-       "first link in that email to confirm.")
+    dbh hostid q
+    ("Please check your email now.  You have been sent a confirmation " ^
+     "email so we can verify the email address is yours.  Click on the " ^
+     "first link in that email to confirm.")
 
 let () =
   register_script ~restrict:[CanView] run