From: rich Date: Mon, 22 Nov 2004 11:11:52 +0000 (+0000) Subject: Email notify when page is renamed. X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=9aed7151b50ec06b0728568e0016f1eb4eb4da4a;p=cocanwiki.git Email notify when page is renamed. --- diff --git a/scripts/rename_page.ml b/scripts/rename_page.ml index 8de584f..579369c 100644 --- a/scripts/rename_page.ml +++ b/scripts/rename_page.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: rename_page.ml,v 1.1 2004/11/22 11:07:32 rich Exp $ + * $Id: rename_page.ml,v 1.2 2004/11/22 11:11:52 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 @@ -28,6 +28,7 @@ open Cocanwiki open Cocanwiki_ok open Cocanwiki_pages open Cocanwiki_strings +open Cocanwiki_emailnotify let run r (q : cgi) (dbh : Dbi.connection) hostid {hostname = hostname} user = let page = q#param "page" in @@ -99,6 +100,15 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid {hostname = hostname} user = (* Finish off XXX *) dbh#commit (); + (* Email notification. *) + let subject = "Page " ^ page ^ " has been renamed" in + + let body = fun () -> + "Old title: " ^ old_title ^ "\n" ^ + "New title: " ^ new_title in + + email_notify ~body ~subject ~user dbh hostid; + let buttons = [ ok_button ("/" ^ new_page) ] in ok ~title:"Page renamed" ~buttons q "That page was renamed."