new user creation notification

gobezu

Joined: 2009-09-21
Posts: 3
Posted: Sun, 2009-09-27 11:01

i would like to have notification sent to the user just created
is this something that's possible or do i need to do my own hack?
thanks!

 
gobezu

Joined: 2009-09-21
Posts: 3
Posted: Sun, 2009-09-27 21:28

Well, in absence of reply I did the following hack, hope it helps and if I have done something wrongly please shout at me:

in modules/core/AdminCreateUser.inc:34

Quote:
global $gallery;

modules/core/AdminCreateUser.inc:85 (after the user actually have been saved and that with success return)

Quote:
$generator =& $gallery->getUrlGenerator();
$baseUrl = $generator->generateUrl(array(),
array('forceFullUrl' => true, 'htmlEntities' => false,
'forceSessionId' => false));

$tplData = array('baseurl' => $baseUrl,
'username' => $form['userName'],
'fullname' => $form['fullName'],
'password' => $form['password1']);

$ret = GalleryCoreApi::sendTemplatedEmail(
'modules/core/templates/CreateUserNotification.tpl', $tplData, null,
$form['email'], "Your album created");

created a template file CreateUserNotification.tpl in modules/core/templates with the following content

Quote:
Dear {$fullname},

A new user and album is created for you at: {$baseurl}

Your username is: {$username}
Your password is: {$password}

Thank you!