[pmwiki-users] Emailform receipe

Peter & Melodye Bowers pbowers at pobox.com
Wed Apr 23 23:04:04 CDT 2008


> How to set global setting from the local/config.php file into 
> the actual
> page, so the settings can be customized on the page itself?
> 
> I am using the emailform receipe and it works great, but I'd 
> like to set
> the:
> 
> $EMailFormAddresses['feedback'] = 'feedback at 911networks.com';
> $EMailFormDefaultSender = 'anonymous at 911networks.com';
> 
> on the page itself instead of local/config.php

You could create your own markup which you would use like this:

(:setupmail feedback=feedback at 911networks.com
sender=anonymous at 911neworks.com:)

markup("setupmail", "<_end", "/\\(:setupmail\s+(.*?):\\)/ie", 
    "MySetupMail(\$pagename, \"\$1\")");  

function MySetupMail($pagename, $opt)
{
   global $EMailFormAddresses, $EMailFormDefaultSender;
   $opt = ParseArgs($opt);
   #echo "Setting...<br>\n";
   $EMailFormAddresses['feedback'] = ($opt['feedback'] ? $opt['feedback'] :
'feedback at 911networks.com');
   $EMailFormDefaultSender = ($opt['sender'] ? $opt['sender'] :
'anonymous at 911networks.com');
}

I don't have emailform installed so I can't test the functionality, but it
calls the function properly so from their on you can hopefully figure out
where it's going.

Do note that your email addresses will be in cleartext if anyone looks at
the source on this page.

-Peter




More information about the pmwiki-users mailing list