email text NOT NULL,
entry_date date DEFAULT ('now'::text)::date NOT NULL,
pending text,
- opt_out text NOT NULL
+ opt_out text NOT NULL,
+ name text NOT NULL
);
(* 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.2 2004/09/24 16:45:02 rich Exp $
+ * $Id: mailing_list_send.ml,v 1.3 2004/09/24 17:11:57 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
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
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 ();
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: mailing_list_view.ml,v 1.1 2004/09/24 17:07:10 rich Exp $
+ * $Id: mailing_list_view.ml,v 1.2 2004/09/24 17:11:57 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
else "text/html", template in
(* Get the mailing list. *)
- let sth = dbh#prepare_cached "select email, entry_date from mailing_lists
+ let sth = dbh#prepare_cached "select email, name, entry_date
+ from mailing_lists
where hostid = ? and pending is null
order by 1" in
sth#execute [`Int hostid];
- let table = sth#map (function [`String email; `Date entry_date] ->
- let entry_date = printable_date' entry_date in
- [ "email", Template.VarString email;
- "entry_date", Template.VarString entry_date ]
- | _ -> assert false) in
+ let table =
+ sth#map (function [`String email; `String name; `Date entry_date] ->
+ let entry_date = printable_date' entry_date in
+ [ "email", Template.VarString email;
+ "name", Template.VarString name;
+ "entry_date", Template.VarString entry_date ]
+ | _ -> assert false) in
template#table "emails" table;
<td> <input name="email" value="" size="50" /> </td>
</tr>
<tr>
+<th> Name: </th>
+<td> <input name="name" value="" size="50" /> </td>
+</tr>
+<tr>
<td></td>
<td> <input type="submit" value=" Send " /> </td>
</tr>
<h1>View or download mailing list</h1>
<table class="top_table">
-<tr><th> Email address </th> <th> Joining date </th></tr>
+<tr><th> Email address </th> <th> Name </th> <th> Joining date </th></tr>
::table(emails)::
-<tr><td> ::email_html:: </td> <td> ::entry_date_html:: </td> </tr>
+<tr><td> ::email_html:: </td> <td> ::name_html:: </td> <td> ::entry_date_html:: </td> </tr>
::end::
</table>
"Email address","Joining date"
-::table(emails)::"::email::","::entry_date::"
+::table(emails)::"::email::","::name::","::entry_date::"
::end::
\ No newline at end of file