feat:
* le remplacement de @@nom@@ renvoi que la valeur du champ nom ou un espace pour supprimer @@nom@@ * le remplacement de @@prenom@@ renvoi que la valeur du champ prenom ou un espace pour supprimer @@prenom@@
This commit is contained in:
parent
f1315dd545
commit
752a00ff4c
1 changed files with 11 additions and 12 deletions
|
@ -14,22 +14,21 @@ 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@@ => $nom ou un espace pour vider le champ @@nom@@
|
||||
**/
|
||||
$nom = sql_getfetsel('nom', 'spip_auteurs', 'email='.sql_quote($args['destinataires'][0]));
|
||||
$prenom = $nom;
|
||||
$nom = sql_getfetsel('nom', 'spip_auteurs', 'email='.sql_quote($args['destinataires'][0])) ?? ' ';
|
||||
$html = gamumail_remplacer_modele('nom', ucwords($nom), $html);
|
||||
|
||||
/**
|
||||
* @@prenom@@ => $prenom ou un espace pour vider le champ @@prenom@@
|
||||
**/
|
||||
$prenom = ' ';
|
||||
$trouver_table = charger_fonction('trouver_table', 'base');
|
||||
$desc = $trouver_table('spip_auteurs');
|
||||
if (array_key_exists('prenom', $desc['field'])
|
||||
and $prenom = sql_getfetsel('prenom', 'spip_auteurs', 'email='.sql_quote($args['destinataires'][0]))) {
|
||||
$nom = $prenom.' '.$nom;
|
||||
if (array_key_exists('prenom', $desc['field'])) {
|
||||
$prenom = sql_getfetsel('prenom', 'spip_auteurs', 'email='.sql_quote($args['destinataires'][0])) ?? ' ';
|
||||
}
|
||||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue