7
emailconfirmcomment
emailconfirmcomment
SYNOPSIS
emailconfirmcomment($node_id, $comment_id, $user_mail, $locale, $sender=false)
DESCRIPTION
emailconfirmcomment envoie un email de confirmation à l'adresse d'email $user_mail contenant un lien qui publie le commentaire $comment_id du nœud $node_id pour la langue $locale.
Si l'email est envoyé avec succès, emailconfirmcomment retourne true, sinon false.
CODE
- require_once 'emailtext.php';
- require_once 'urlencodeaction.php';
- function emailconfirmcomment($node_id, $comment_id, $user_mail, $locale, $sender=false) {
- global $base_url;
- $saction_page=url('saction', $locale);
- if (!$saction_page) {
- return false;
- }
- $id=CONFIRMCOMMENT;
- $param=array($node_id, $comment_id, $locale);
- $s64=urlencodeaction($id, $param);
- if (!$s64) {
- return false;
- }
- $url = $base_url . $saction_page . '/' . $s64;
- $to=$user_mail;
- $subject = translate('email:comment_subject', $locale);
- $f=translate('email:comment_confirm', $locale);
- $s=sprintf($f, $url);
- $msg = $s . "\n\n" . translate('email:salutations', $locale);
- return @emailtext($msg, $to, $subject, $sender);
- }
Commentaires