[pmwiki-users] fox comment box and mail

Hans design5 at softflow.co.uk
Fri Jun 27 05:39:07 CDT 2008


Friday, June 27, 2008, 8:25:35 AM, Maria McKinley wrote:

> Just wondering if anyone has ever setup a comment box that sends and
> email notification when someone posts a new comment. Would be
> interested if there were an easy way of doing this.

Here is an example modified fox commentbox, the second line is added,
it needs http://www.pmwiki.org/wiki/Cookbook/FoxNotify to be
installed (and Fox of course):

(:fox cbox put=aboveform template=Site.FoxCommentTemplate:)
(:foxmail template=FoxNotifyLists.MailFormTemplate target=FoxNotifyLists.EmailList :)
|| Heading:||(:input text heading size=60:)
|| ||'''Your Message''' ||
|| ||(:input textarea comment cols=60 rows=6:) ||
|| Author:||(:input text author value='{$Author}' :) (:input submit post Enter:) ||
(:foxend cbox:)


Notification will be sent to addresses specified on
FoxNotifyLists.EmailList. You could choose a different page.
The notification will use as an email template
FoxNotifyLists.MailFormTemplate. Again you could set this up on a
different page (use perhaps different pages for different Fox forms,
according to what shall be mailed, in what format).

If you put the mail target and mail template pages into a different
group, for instance 'Site',, you need to set in config.php the variable
$FoxNotifyListsGroup = 'Site';


An example for a mail template for the comment form above, which uses
the input field names as replacement variables in the template:

(:linebreaks:)
!!Email subject format
[[#subject]]
$WikiTitle Contakt Message
[[#subjectend]]

!!Email body heading format
[[#heading]]
Newest enquiry on $WikiTitle ContactUs page:
[[#headingend]]

!!Email item formats
[[#default]]
Sent: $PostTime 
Name: {$$author}
Subject: {$$heading}

{$$comment}

============================
Sent by $WikiTitle Server
[[#defaultend]]


an example for the mail target page:

 notify=someone at example.com
 notify=another at abc.org


Hope this gets you going!

  ~Hans




More information about the pmwiki-users mailing list