X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=scripts%2Fmailing_list_send.ml;h=5974e13e553382d246b08ef6fdb8a80c3e15a6b2;hb=288535f82bf4a5d944536bd0790a54a5f8fb4363;hp=ce239cc85e4fcbdd49b87a9523475f2a4b123d85;hpb=8d82e370518cb6d936682c6550d0c0bf0b0e0b35;p=cocanwiki.git diff --git a/scripts/mailing_list_send.ml b/scripts/mailing_list_send.ml index ce239cc..5974e13 100644 --- a/scripts/mailing_list_send.ml +++ b/scripts/mailing_list_send.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: mailing_list_send.ml,v 1.1 2004/09/24 16:41:16 rich Exp $ + * $Id: mailing_list_send.ml,v 1.4 2004/10/04 15:19:56 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 @@ -33,6 +33,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ = let template = get_template dbh hostid "mailing_list_send.txt" in let email = trim (q#param "email") in + let name = trim (q#param "name") in if email = "" then ( error ~title:"No email address" ~back_button:true @@ -72,9 +73,10 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ = let opt_out = random_sessionid () in (* Insert into the database. *) - let sth = dbh#prepare_cached "insert into mailing_lists (hostid, email, - pending, opt_out) values (?, ?, ?, ?)" in - sth#execute [`Int hostid; `String email; `String pending; `String opt_out]; + let sth = dbh#prepare_cached "insert into mailing_lists (hostid, email, name, + pending, opt_out) values (?, ?, ?, ?, ?)" in + sth#execute [`Int hostid; `String email; `String name; + `String pending; `String opt_out]; dbh#commit (); @@ -88,11 +90,11 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ = Sendmail.send_mail ~subject ~body ~to_addr:[email] (); (* Finish up. *) - let buttons = [ ok_button ("/" ^ page) ] in + 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.") let () = - register_script run + register_script ~restrict:[CanView] run