diff --git a/formulaires/gamumail.html b/formulaires/gamumail.html
index 2b021bd..427a3a1 100644
--- a/formulaires/gamumail.html
+++ b/formulaires/gamumail.html
@@ -122,6 +122,7 @@
[(#CHEMIN{gamumail/#GET{fichier}.html}|oui)
#SET{erreurs,#ENV**{erreurs}|table_valeur{Tid_doc}}
[(#GET{erreurs})]
+
<:gamumail:fichiers_annexes:>
]
diff --git a/formulaires/gamumail.php b/formulaires/gamumail.php
index 9f4113c..4c8ef87 100644
--- a/formulaires/gamumail.php
+++ b/formulaires/gamumail.php
@@ -311,6 +311,11 @@ function formulaires_gamumail_traiter_dist($slug, $destinataires = 0, $Tclient =
'args' => $args,
'data' => $html
));
+
+ // traitement des remplacements génériques fournis par Gamumail
+ $remplacement_generiques = charger_fonction('gamumail_remplacements', 'inc');
+ $html = $remplacement_generiques($args, $html);
+
$texte = facteur_mail_html2text($html);
$corps = [
'html' => $html,
diff --git a/gamumail_options.php b/gamumail_options.php
index f5bc60a..71f1d42 100644
--- a/gamumail_options.php
+++ b/gamumail_options.php
@@ -29,6 +29,7 @@ function crayons_determine_input_mode_type_gamumail($type, $champ, $sqltype) {
**/
$GLOBALS['remplacements_gamumail'] = [
'@@nom@@' => _T('gamumail:nom'),
+ '@@prenom@@' => _T('gamumail:prenom_sinon_nom'),
'@@url_site@@' => _T('gamumail:url_site'),
'@@url_raz_passe@@' => _T('gamumail:url_raz_passe'),
];
diff --git a/inc/gamumail_remplacements.php b/inc/gamumail_remplacements.php
index 94ddf49..a291cca 100644
--- a/inc/gamumail_remplacements.php
+++ b/inc/gamumail_remplacements.php
@@ -13,11 +13,11 @@ if (!defined('_ECRIRE_INC_VERSION')) {
*
**/
function inc_gamumail_remplacements_dist($args, $html) {
-
/**
* @@nom@@ => Prenom Nom | Nom (gère la présence/absence du champ prenom dans spip_auteurs)
**/
$nom = sql_getfetsel('nom', 'spip_auteurs', 'email='.sql_quote($args['destinataires'][0]));
+ $prenom = $nom;
$trouver_table = charger_fonction('trouver_table', 'base');
$desc = $trouver_table('spip_auteurs');
if (array_key_exists('prenom', $desc['field'])
@@ -25,6 +25,7 @@ function inc_gamumail_remplacements_dist($args, $html) {
$nom = $prenom.' '.$nom;
}
$html = gamumail_remplacer_modele('nom', ucwords($nom), $html);
+ $html = gamumail_remplacer_modele('prenom', ucwords($prenom), $html);
/**
* @@url_site@@ => URL du site
diff --git a/lang/gamumail_fr.php b/lang/gamumail_fr.php
index 8097876..2bc3871 100644
--- a/lang/gamumail_fr.php
+++ b/lang/gamumail_fr.php
@@ -37,7 +37,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
'explication_mail_auto_uniquement' => 'permet de ne pas afficher les modèles utilisés uniquement en envoi automatique',
// F
- 'pdf_envoyes' => 'Fichiers PDF envoyés',
+ 'fichiers_annexes' => 'Fichiers annexes',
// I
'icone_creer_gamumail' => 'Créer un gamumail',
@@ -71,6 +71,8 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
// P
'pas_de_slug' => 'Pas de slug avec cet identifiant',
'plusieurs_mails_separer_virgule' => 'Si plusieurs emails, les séparer par une virgule.',
+ 'pdf_envoyes' => 'Fichiers PDF générés',
+ 'prenom_sinon_nom' => 'Prénom du destinataire (ou Nom si pas de champ "prenom")',
// R
'retirer_lien_gamumail' => 'Retirer ce gamumail',