ajout fonction : gamumail_remplacer_modele()
This commit is contained in:
parent
000ffb8478
commit
3a8356e81b
1 changed files with 20 additions and 12 deletions
|
@ -90,7 +90,7 @@ function gamumail_verifier_dist($erreurs, $options, $slug, $destinataires='', $T
|
|||
function gamumail_traiter_dist($corps, $options, $slug, $destinataires='') {
|
||||
|
||||
$html = $corps['html'];
|
||||
$html = str_replace('@@truc_a_remplacer@@', 'le machin qui remplace', $html);
|
||||
$html = gamumail_remplacer_modele($html, '@@truc_a_remplacer@@', 'le machin qui remplace');
|
||||
include_spip('classes/facteur');
|
||||
$texte = facteur_mail_html2text($html);
|
||||
$corps['html'] = $html;
|
||||
|
@ -99,3 +99,11 @@ function gamumail_traiter_dist($corps, $options, $slug, $destinataires='') {
|
|||
return $corps;
|
||||
}
|
||||
|
||||
|
||||
function gamumail_remplacer_modele($modele, $val, $texte){
|
||||
if ($texte and $modele and $val) {
|
||||
return str_replace('@@'.$modele.'@@', $val, $texte);
|
||||
}
|
||||
return $texte;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue