(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: contact.ml,v 1.12 2006/07/31 09:10:33 rich Exp $
+ * $Id: contact.ml,v 1.14 2006/12/06 09:46: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
let subj_rex = Pcre.regexp "\\$\\w+"
let run r (q : cgi) dbh hostid {hostname = hostname} user =
- let template = get_template dbh hostid "contact.txt" in
+ let template = get_template r dbh hostid "contact.txt" in
let fail msg =
error ~back_button:true ~title:"Bad form"
- dbh hostid q (msg ^ " Please contact the owner of the site by email.");
+ r dbh hostid q
+ (msg ^ " Please contact the owner of the site by email.");
return ()
in
template#set "nr_uploads" (string_of_int (List.length uploads));
(* Send the initial email. *)
+ let content_type =
+ "text/plain", ["charset", Mimestring.mk_param "UTF-8"] in
let body = template#to_string in
- let msg = Netsendmail.compose ~to_addrs ~subject body in
+ let msg = Netsendmail.compose ~to_addrs ~subject ~content_type body in
Netsendmail.sendmail msg;
(* Send the following uploads by email. *)
(* Confirm. *)
ok ~title:"Thank you for your contact" ~buttons:[ok_button "/"]
- dbh hostid q "An email was sent and you should receive a reply shortly."
+ r dbh hostid q "An email was sent and you should receive a reply shortly."
let () =
register_script ~restrict:[CanView] run