diff --git a/inc/gamumail_remplacements.php b/inc/gamumail_remplacements.php index a291cca..220f06c 100644 --- a/inc/gamumail_remplacements.php +++ b/inc/gamumail_remplacements.php @@ -5,12 +5,12 @@ if (!defined('_ECRIRE_INC_VERSION')) { /** * fonction pour les remplacements génériques fournis par gamumail - * + * * @param array $args = ['slug' => $slug, 'destinataires' => $pour, [$options]] * @param string $data = $html - * + * * @return $html - * + * **/ function inc_gamumail_remplacements_dist($args, $html) { /** @@ -24,8 +24,12 @@ function inc_gamumail_remplacements_dist($args, $html) { and $prenom = sql_getfetsel('prenom', 'spip_auteurs', 'email='.sql_quote($args['destinataires'][0]))) { $nom = $prenom.' '.$nom; } - $html = gamumail_remplacer_modele('nom', ucwords($nom), $html); - $html = gamumail_remplacer_modele('prenom', ucwords($prenom), $html); + if ($nom) { + $html = gamumail_remplacer_modele('nom', ucwords($nom), $html); + } + if ($prenom) { + $html = gamumail_remplacer_modele('prenom', ucwords($prenom), $html); + } /** * @@url_site@@ => URL du site