|
Cookbook /
FoxNotify-CommentsComments and Discussion about FoxNotifyLeave latest message at the top please!Users with edit-priviledges maintaining FoxNotify settingsScenario: 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. 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("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 attachmentIs it possible to have FoxNotify send a file as an attachment.?? Graham April 1 2008 FoxNotify email footerHi - 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 \then later, adding a global variable for $FoxNotifyBodyFooterFmt: function FoxNotifyUpdate($pagename, $dir='') {
global $FoxNotifyList, $FoxNotifyLists, $FoxGeneralNotifyList, $FoxNotifyFile, 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 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 |