Hi,
I would like to receive an email when a user register on the gallery. I think it will be quite easy since there is already a function to receive email when a comment is added. But I don't find where is this function ???
Thanks.
function is "notify", you'll find it in the include/functions.inc.php :-D
Offline
OK, thanks a lot.
For anyone wants to do the same thing :
I have modified the file functions.inc.php :
// add by me, for reveive email when new_user case 'new_user' : $subject = $lang['mail_new_user_subject']; $content.= $lang['mail_new_user_content']; break; // end add by me
Then, the file language/francais.php where I add the translation for mail_new_user_subject and _content
And, the file register.php :
//----------------------------------------------------------- user registration $error = array(); if ( isset( $_POST['submit'] ) ) { $error = register_user( $_POST['login'], $_POST['password'], $_POST['password_conf'], $_POST['mail_address'] ); if ( sizeof( $error ) == 0 ) { $session_id = session_create( $_POST['login'] ); $url = 'category.php?id='.$session_id; header( 'Request-URI: '.$url ); header( 'Content-Location: '.$url ); header( 'Location: '.$url ); // mail notification for administrators if ( $conf['mail_notification'] ) { notify('new_user',$_POST['login']); } // end mail notification exit(); } }
Would someone know why I get two emails instead of one when a new user registers ?
The first email does not have the user login at the end, the second has it.
I tried to understand but could not find the answer.
Hosting = free.fr, I modified removed $options in the mail instruction to be compatible with free.fr. Can it come from there ?
Thanks.
PDG wrote:
OK, thanks a lot.
For anyone wants to do the same thing :
I have modified the file functions.inc.php :Code:
// add by me, for reveive email when new_user case 'new_user' : $subject = $lang['mail_new_user_subject']; $content.= $lang['mail_new_user_content']; break; // end add by meThen, the file language/francais.php where I add the translation for mail_new_user_subject and _content
And, the file register.php :Code:
//----------------------------------------------------------- user registration $error = array(); if ( isset( $_POST['submit'] ) ) { $error = register_user( $_POST['login'], $_POST['password'], $_POST['password_conf'], $_POST['mail_address'] ); if ( sizeof( $error ) == 0 ) { $session_id = session_create( $_POST['login'] ); $url = 'category.php?id='.$session_id; header( 'Request-URI: '.$url ); header( 'Content-Location: '.$url ); header( 'Location: '.$url ); // mail notification for administrators if ( $conf['mail_notification'] ) { notify('new_user',$_POST['login']); } // end mail notification exit(); } }
It's that ok for 1.4.0 ? And for any language ?
thanks
Offline
i tried to modify the files you specify but i don t think i did the right thing 'cause once done, i couldn t log on the gallery anymore.
i put your modification at the end of each file. but i don t think that this is the right way.
could you tell me where to put them please?
i m using phpwebgallery 1.4
Well... J'aimerai bien également recevoir des mails quand un nouveau visiteur s'enregistre 8-)
Quelqu'un pourrait il donner la solution en français ?
Offline
Bonjour Zorg, (si je puis me permettre lol),
toi qui est le maitre du php, pourrais tu me repondre ou je dois inserer ces fichiers stp?
merci d avance