Recent Changes - Search:

Cookbook

PmWiki

pmwiki.org

FoxNotify-Comments

Comments and Discussion about FoxNotify

Leave latest message at the top please!

Using PTVs or input variables in the email subject

Is there some way of being able to put a PTV into the subject line of the foxnotify e-mail: i.e.

[[#subject]]
New Billing Request from {$$RequestorName}
[[#subjectend]]

Download the latest foxnotify.phpΔ, then add a hidden input field to pick up a PTV, like

(:input hidden RequestorName '{$PageName$:RequestorName}':)

which passes on the PTV named 'RequestorName' from page 'PageName' as a replacement variable.
Then use the template as above. - HansB September 29, 2008, at 11:50 AM


use of single quotes in message strings

I am using the following French foxmessage in my foxform:

foxcheckmsg="Le Formulaire n'est pas correctement rempli ! Il n'a été validé. Merci de corriger et de re-soumettre."

Unfortunately the ' characters seem to be interpreted as end of string - so that the message on the screen is shown only as..

Is there a way around this. I tried various combinations but none worked for me.

use ' instead of '


e-mail address in form field?

Is it possible to have an e-mail address - entered within the input form - to be then used by Foxnotify? What I'm wanting is for the submitter to complete the form - it then gets sent via e-mail to the correct team AND at the same time, the submitter gets a CC: of the form for their own records - also by e-mail. So the submitter would complete the details required for the form, add their own e-mail addres and a copy of the form is sent to them.

Foxnotify does not allow this for the same reasons Notify does not allow it: it could lead to abuse, posters could use a form to send content to email addresses of their choosing, i.e. it could be used for spamming. Therefor all email adresses must be on some specific list. - HansB

I understnad the intent, however my wiki is behind a Corporate firewall and the users follow the correct etiquette. What my users are used to having is some kind of "reciept" that shows they did indeed submit the form. Else they have no proof when they wish to follow up if no response is received. Today this is most often done by the form BCC'ing the individual. I can make the form only allow a @mydomain.com e-mail addresses - so I would like the ability for the user to get a copy some how. An alternative is to write the form to apage - but that would be a heck of a lot of pages - that are in fact just e-mail templates - lying around on the wiki.

allowing email addresses as targets under special conditions is quite difficult to implemenmt as it requires some rather complex code changes both in fox.php and foxnotify.php. Not sure if or when i may be getting around doing this. HansB September 23, 2008, at 03:16 AM


Users with edit-priviledges maintaining FoxNotify settings

Scenario: users have their own Groups, which only they maintain with their own password. They all have a $Group/$Group-Notify page where they can add and delete their email address for notification purposes when a visitor makes a comment within their group.
Problem I was having: Captcha was preventing the user from deleting their email address on FoxNotifyLists. Even though the group-editor was able to successfully add an email without any Captcha present (it's turned off if you have edit-priviledges), I believe Captcha was turning back on when attempting to reach over and access FoxNotifyLists.
Current Settings that "solved" this problem:

if (CondAuth($pagename,'admin')) {
$FoxPagePermissions['*.*'] = 'all'; 
} 
elseif (CondAuth($pagename,'edit')) {
$FoxPagePermissions['*.*'] = 'add,delete'; 
# where $group is defined in config.php as PageVar($pagename,'$Group');
$FoxPagePermissions['$group.*'] = 'all';
} 
elseif (CondAuth($pagename,'read')) {
$FoxPagePermissions['*.*'] = 'add'; 
$FoxPagePermissions['FoxNotifyLists.*'] = 'add,delete'; 
# this latter part is necessary to delete emails from FoxNotifyLists
# because the user's Auth is only 'read' for this area...
}

include_once("$FarmD/cookbook/fox/fox.php");
include_once("$FarmD/cookbook/fox/foxdelete.php");

//// CAPTCHA -- THIS CAN CAUSE MANY PROBLEMS IF YOU'RE NOT CAREFUL /////
## was causing -Notify pages to not allow users to 'delete' email entries
$EnablePostCaptchaRequired = 1; # turn captcha on by default
# permit those logged in with 'edit' priv's to have captcha turned OFF
if (CondAuth($pagename,'edit') || $action=='foxdelete') {
$EnablePostCaptchaRequired = 0; 
# must be turned off here, or else won't let user delete pages
}
include_once('cookbook/captcha.php');
include_once("$FarmD/cookbook/fox/foxnotify.php");

this part under CondAuth=='read' seems iffy:

$FoxPagePermissions['FoxNotifyLists.*'] = 'add,delete';

... potentially a security risk, right? but the only way i could get it to work...

anyhow, it seems to work now, and i think setting other precautions (basic read/display priviledges) on certain pages with fox forms will most likely [hopefully] do the trick...

overtones99 July 10, 2008, at 08:23 PM


FoxNotify email attachment

Is it possible to have FoxNotify send a file as an attachment.?? Graham April 1 2008
It is not possible a far as I know, and I think it would be quite difficult to implement, if possible at all. HansB


FoxNotify email footer

Hi - how would i go about sticking a footer into my notification email created by Fox? I'd like to have a line added to emails reminding recipients of unsubscription options, and maybe even some website tagline stuff at the end... however, right now it appears adding this info to Email Item Formats (say, #default), would result in the footer being repeated if there are multiple posts being reported, right? Is there an easy way to mod FoxNotify so that a footer is amended if supplied? Thanks! overtones99 March 28, 2008, at 09:29 PM

I think it may work if you change $FoxNotifyBodyFmt to include a footer variable. Try this in config:

# change body format to include footer var:
$FoxNotifyBodyFmt = 
   "\$FoxNotifyBodyHeadingFmt" 
   ."\$FoxNotifyItems\n\n"
   ."\$FoxNotifyBodyFooterFmt\n";
# add new footer var:
$FoxNotifyBodyFooterFmt = "my footer stuff....";

To make this variable configurable via the FoxNotifyTemplates page would need some alterations of the foxnotify.php script. HansB March 29, 2008, at 03:37 AM

Just in case others might like to see, i altered my version of foxnotify.php in the following places in order to have it add footers:

SDV($FoxNotifyBodyFooterFmt, "You have received this email because you're signed up 
    to receive notifications from \$WikiTitle");  // <- new
 SDV($FoxNotifyBodyFmt, 
   "\$FoxNotifyBodyHeadingFmt\n" 
   ."\$FoxNotifyItems\n\n"
   ."\$FoxNotifyBodyFooterFmt\n");     // <- new

then later, adding a global variable for $FoxNotifyBodyFooterFmt:

function FoxNotifyUpdate($pagename, $dir='') {
  global $FoxNotifyList, $FoxNotifyLists, $FoxGeneralNotifyList, $FoxNotifyFile, $IsPagePosted,
    $FmtV, $FoxNotifyTimeFmt, $FoxNotifyItemFmt, $FoxNotifyTemplatePageFmt, $FoxNotifyListsGroup,
    $FoxNotifySquelch, $FoxNotifyDelay, $Now, $SearchPatterns, $WikiTitle, $FoxRecipient,
    $FoxNotifySubjectFmt, $FoxNotifyBodyFmt, $FoxNotifyBodyHeadingFmt, 
        /* new => */ 
    $FoxNotifyBodyFooterFmt, $FoxNotifyHeaders, $FoxNotifyParameters;

and then amending in one more spot:

if(PageExists($tpname)) {
   $tpage = ReadPage($tpname, READPAGE_CURRENT);
   $tsubject = trim(TextSection($tpage['text'], '#subject'),"\r\n");
   $tbodyheading = trim(TextSection($tpage['text'], '#heading'),"\r\n");
   $tbodyfooter = trim(TextSection($tpage['text'], '#footer'),"\r\n");   // <- new
}
if(!$tsubject) $tsubject = $FoxNotifySubjectFmt;
$subject = FmtPageName($tsubject, $pagename);
if($tbodyheading) $FoxNotifyBodyHeadingFmt = $tbodyheading;
if($tbodyfooter) $FoxNotifyBodyFooterFmt = $tbodyfooter;   // <- new

this works great!! overtones99 March 30, 2008, at 06:43 PM


FoxNotify form: odd characters >>> & <<<

Hi again, Just wondering what <<< and >>> are supposed to do in the code on FoxNotify? I have the feeling it's supposed to be for a newline [[<<]], right? thanks! overtones99 March 24, 2008, at 11:21 PM

It is supposed to say that the code line is continuing, i.e. the next line in the example belong to the previous line. It is NOT part of the code! sorry if that caused confusion! Sometimes source code has very long lines, and posting them to display as source code can destroy the skin layout. HansB


emails in HTML?

Could Foxnotify have the means to format the mail so that an e-mail reader (i.e. Thunderbird) could display the mail as html rather than plain text? Graham 2008-03-26

it may be possible by adding or changing various FoxNotify config variables, in order to add the necessary declarations for coding, mime-type, and tags. But I have not tried. HansB

The following can perhaps give you some ideas. But note that you can't use the FoxNotifyTemplates for inserting HTML tags, unless you specifically allow certain html tags for it (possibly).

add in config.php (and don't use/remove/rename FoxNotifyTemplates)

//the next makes the email into HTML formatted email
$FoxNotifyHeaders = 'MIME-Version: 1.0' . "\r\n"
        .'Content-type: text/html; charset=iso-8859-1' . "\r\n";

//try adding some HTML tags
//heading in the email body:
$FoxNotifyBodyHeadingFmt = "<h3>Recent \$WikiTitle posts: </h3>\n";

//each notify item:
$FoxNotifyItemFmt = "<a href='$ScriptUrl/{\$FullName}'>$ScriptUrl/{\$FullName}</a>"
             ." . . . $PostTime by <b>{$LastModifiedBy}</b><br /> \n";

//adding a footer
$FoxNotifyFooterFmt = "<br /><i>mail sent by pmwiki notification service</i>";  

$FoxNotifyBodyFmt = 
   "\$FoxNotifyBodyHeadingFmt" 
   ."\$FoxNotifyItems\n"
   ."\$FoxNotifyFooterFmt\n";

I have two forms in my site. How can I specify two different "subject" in the "FoxNotifyTemplates" page? Pierre 2008-02-12

I have no easy solution for this. Presently you can specify different template formats for the email body only. Maybe i can change that in future to allow specifying formats for header and subject. Right now you can try to load a different FoxNotifyTemplate page for each of your form pages, using conditionals in config.php to set $FoxNotifyTemplatePageFmt, somthing like this:

$name = PageVar($pagename, '$FullName');
if ($name=='SomeGroup.SomePageA')
   $FoxNotifyTemplatePageFmt = ""$FoxNotifyListsGroup.FoxNotifyTemplatesA";
if ($name=='SomeGroup.SomePageB')
   $FoxNotifyTemplatePageFmt = ""$FoxNotifyListsGroup.FoxNotifyTemplatesB";
include_once("$FarmD/cookbook/fox/foxnotify.php");

HansB February 13, 2008, at 05:59 AM


Edit - History - Print - Recent Changes - Search
Page last modified on September 29, 2008, at 11:51 AM