33 lines
974 B
PHP
33 lines
974 B
PHP
<?php
|
|
if (!defined('_ECRIRE_INC_VERSION')){
|
|
return;
|
|
}
|
|
|
|
|
|
/**
|
|
* envoi un mail apres nouvelle inscription
|
|
*
|
|
* @param int $id_auteur
|
|
* @param array $options (optional)
|
|
*
|
|
* @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'];
|
|
|
|
$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);
|
|
}
|
|
}
|