XQuery/Basic Feedback Form

Motivation
You want to gather feedback from visitors.

Implementation
A simple HTML form gathers suggested improvements and an email address. The suggestion is emailed to one of the authors and an acknowledgment sent to the submitter. Here the default send-mail client on the eXist implementation at UWE, Bristol is used.

XQuery script
xquery version "1.0"; (: A simple Feedback form using the eXist mail module :) import module namespace mail="http://exist-db.org/xquery/mail"; declare option exist:serialize "method=xhtml media-type=text/html";

let $comment:= normalize-space(request:get-parameter("comment","")) let $email := normalize-space(request:get-parameter("email","")) return Feedback on the XQuery Wikibook Feedback on the XQuery Wikibook Please let us know how this Wikibook could be improved.  Your email address   {if ($email ne "" and $comment ne "") then let $commentMessage := {$email} kit.wallace@gmail.com Wikibook Feedback {$comment} let $ackMessage := {$email} kit.wallace@gmail.com Wikibook Feedback Many thanks for your feedback - we appreciate your interest in this collaborative work. let $sendcomment := mail:send-email($commentMessage,,) let $sendack := mail:send-email($ackMessage,,) return if ($sendcomment and $sendack) then Feedback You suggested that the XQuery Wikibook could be improved by: {$comment}. Thanks for the feedback. else Something went wrong - please try again else if ($comment ne "") then Please provide an email address so that we can let you know of progress on your suggestion. else }

Feedback Form