si gamumail est activé et le slug mail_inscription existe, passer par Gamumail pour l'envoi du mail d'inscription
This commit is contained in:
parent
e72c81d385
commit
884bab15fc
1 changed files with 15 additions and 10 deletions
|
@ -13,16 +13,21 @@ if (!defined('_ECRIRE_INC_VERSION')){
|
|||
* @return void
|
||||
*/
|
||||
function inc_comptespip_mail_inscription_dist(int $id_auteur, array $options = []) :void{
|
||||
if (test_plugin_actif('gamumail') and sql_countsel('slug', 'spip_gamumails', 'slug=mail_inscription')) {
|
||||
$envoyer_gamumail = charger_fonction('envoyer_gamumail', 'inc');
|
||||
$envoyer_gamumail('mail_inscription', $id_auteur, ['args' => $options]);
|
||||
}
|
||||
else {
|
||||
$contexte = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.intval($id_auteur));
|
||||
if (isset($options['pass'])) {
|
||||
$contexte['pass'] = $options['pass'];
|
||||
}
|
||||
$mail_complet = $contexte['email'];
|
||||
|
||||
$contexte = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.intval($id_auteur));
|
||||
if (isset($options['pass'])) {
|
||||
$contexte['pass'] = $options['pass'];
|
||||
$message = recuperer_fond('modeles/mail_inscription',$contexte);
|
||||
$sujet = lire_config('comptespip/mail_inscription_sujet');
|
||||
|
||||
include_spip('inc/notifications');
|
||||
notifications_envoyer_mails($mail_complet, $message, $sujet);
|
||||
}
|
||||
$mail_complet = $contexte['email'];
|
||||
|
||||
$message = recuperer_fond('modeles/mail_inscription',$contexte);
|
||||
$sujet = lire_config('comptespip/mail_inscription_sujet');
|
||||
|
||||
include_spip('inc/notifications');
|
||||
notifications_envoyer_mails($mail_complet, $message, $sujet);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue