meta données pour cette page
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
demo:bureaucracy [2011/03/29 00:49] ztrulphcs [Bureaucracy] |
demo:bureaucracy [2011/06/21 06:10] ztrulphcs [Modification] |
||
---|---|---|---|
Ligne 14: | Ligne 14: | ||
Pour l' | Pour l' | ||
+ | Il suffit de remplacer le fichier '' | ||
+ | ++++cette version| | ||
+ | <code php mail.php> | ||
+ | <?php | ||
+ | /** | ||
+ | * Action sendemail for DokuWiki plugin bureaucracy | ||
+ | */ | ||
+ | |||
+ | class syntax_plugin_bureaucracy_action_mail extends syntax_plugin_bureaucracy_action { | ||
+ | |||
+ | /** | ||
+ | * Build a nice email from the submitted data and send it | ||
+ | */ | ||
+ | function run($data, $thanks, $argv) { | ||
+ | global $ID; | ||
+ | |||
+ | // get recipient address(es) | ||
+ | if( file_exists( $f=wikiFN( ': | ||
+ | $mailads = array(); | ||
+ | $lines = file($f); | ||
+ | foreach($lines as $line){ | ||
+ | $line = preg_replace('/# | ||
+ | $line = trim($line); | ||
+ | if(empty($line)) continue; | ||
+ | |||
+ | $row = split( " | ||
+ | $mails[trim($row[0])] = trim($row[1]); | ||
+ | } | ||
+ | foreach( $argv as $mailad ) { | ||
+ | if( array_key_exists( $mailad, $mails)) { | ||
+ | $mailads[] = $mails[ $mailad ]; | ||
+ | } | ||
+ | else { | ||
+ | $mailads[] = $mailad; | ||
+ | } | ||
+ | } | ||
+ | $to = join(',', | ||
+ | } | ||
+ | else | ||
+ | $to = join(',', | ||
+ | |||
+ | $sub = sprintf($this-> | ||
+ | $txt = sprintf($this-> | ||
+ | |||
+ | foreach($data as $opt){ | ||
+ | $value = $opt-> | ||
+ | $label = $opt-> | ||
+ | |||
+ | switch($opt-> | ||
+ | case ' | ||
+ | $txt .= " | ||
+ | break; | ||
+ | default: | ||
+ | if($value === null || $label === null) break; | ||
+ | $txt .= $label." | ||
+ | $txt .= " | ||
+ | } | ||
+ | } | ||
+ | |||
+ | global $conf; | ||
+ | if(!mail_send($to, | ||
+ | throw new Exception($this-> | ||
+ | } | ||
+ | return $thanks; | ||
+ | } | ||
+ | |||
+ | } | ||
+ | // vim: | ||
+ | </ | ||
+ | ++++ | ||
--- // | --- // |