Hi,
I run a gallery for a student society, whereby I only want to grant full CPG access to users who are already members of the society. They identify themselves in other ways via email address, which ATM I am manually checking against the database. But CPG doesn't display the user email address, just their username. Is there any way I can modify the activation request to include the users email address?
Register.php, find
$template_vars = array(
'{SITE_NAME}' => $CONFIG['gallery_name'],
'{USER_NAME}' => $user_name,
'{ACT_LINK}' => $act_link,
);
Add in a new tag
$template_vars = array(
'{SITE_NAME}' => $CONFIG['gallery_name'],
'{USER_NAME}' => $user_name,
'{ACT_LINK}' => $act_link,
'{EMAIL}' => $email
);
Edit your lang file (eg. lang/english.php), find
$lang_register_approve_email = <<<EOT
A new user with the username "{USER_NAME}" has registered in your gallery.
In order to activate the account, you need to click on the link below or copy and paste it in your web browser.
<a href="{ACT_LINK}">{ACT_LINK}</a>
EOT;
Add in a new tag
$lang_register_approve_email = <<<EOT
A new user with the username "{USER_NAME}" and email "{EMAIL}" has registered in your gallery.
In order to activate the account, you need to click on the link below or copy and paste it in your web browser.
<a href="{ACT_LINK}">{ACT_LINK}</a>
EOT;
That should work.
I like this. However I dont have authorisations on but would like to see the email of the person registered in the admin notification. I assume its the same thing and I need to edit this: 'notify_admin_email_body' => 'A new user with the username "%s" has registered in your gallery',
but I dont know what to add. thanks.
Add in an extra %s into that string, and then add a new param to the sprintf
cpg_mail('admin', sprintf($lang_register_php_def['notify_admin_email_subject'], $CONFIG['gallery_name']), sprintf($lang_register_php_def['notify_admin_email_body'], $user_name, $email));
Change the order of the params to sprintf to match the order of the %s in the lang var.
Thank you Nibbler. works great, as you said. I have tested the authorisation email and it works too, so you can mark this solved!
Just because you hijacked a thread and got an answer doesn't mean the thread is solved. ;)
As it happens, I have tried the above by editing the file remotely and it hasn't worked just yet. But I am not at my current system so will have to wait until tonight when I get back and actually have a proper poke around. Results later - stand by! :)
Hi, sorry for the delay. I can confirm that the above has worked absolutely perfectly. Many thanks to Nibbler for such a fast and useful response!