[SOLVED] New user notice email only sent to Super Admin

Started by onlinestorenut, January 13, 2011, 05:49:46 AM

Previous topic - Next topic

onlinestorenut

Hi,

I have a Super Admin and normal Admin accounts, both set to Receive System Emails.
However, when a user registers via the normal VM registration process, only my Super Admin receives the new user notice email.

I originally thought it was something in Joomla (http://forum.joomla.org/viewtopic.php?f=431&t=503445&p=2373927#p2373927) but they're saying VM has it's own registration process.

I've tried to work this out myself and got as far as thinking it's something to so with a submitregistration() function and/or ps_userfield.php but I can't even find the submitregistration function or anything to do with emailing super admins in that PHP file. I'm now completely stuck.

Does anyone know which file in VM emails the Super Admins when a user registers? I need to change it so that it emails normal Admin as well.

Thanks,
Bob.
[URL=[url="http://www.actiononline.co.nz"]http://www.actiononline.co.nz[/url]]Web Site Design[/URL] | [URL=[url="http://www.actiononline.co.nz/web-design/web-design-wellington.html%5DWeb"]http://www.actiononline.co.nz/web-design/web-design-wellington.html]Web[/url] Design Wellington[/URL]

onlinestorenut

Just wondering if anyone has an idea on this please?

Basically all I need is my Admins, as well as Super Admins, to be emailed when a user registers on my website via the VM registration process.
[URL=[url="http://www.actiononline.co.nz"]http://www.actiononline.co.nz[/url]]Web Site Design[/URL] | [URL=[url="http://www.actiononline.co.nz/web-design/web-design-wellington.html%5DWeb"]http://www.actiononline.co.nz/web-design/web-design-wellington.html]Web[/url] Design Wellington[/URL]

onlinestorenut

#2
I finally found the solution (had to do a file search for all files containing the text 'super admin' then checked each one!!!).

The code which emails Super Admins is in PS_SHOPPER.PHP

PLEASE NOTE: This is a core HACK. You'll probably have to re-do when you upgrade VM.

Around line 828, there a bit of code which gets the Super Admins ID for the email notice.

// get superadministrators id
$admins = $acl->get_group_objects( 25, 'ARO' );
if( empty( $admins['users'] )) {
return;
}
foreach ( $admins['users'] AS $id ) {
$query = "SELECT email, sendEmail"
. "\n FROM #__users"
."\n WHERE id = $id"
;
$database->setQuery( $query );
$rows = $database->loadObjectList();

$row = $rows[0];

if ($row->sendEmail) {
vmMail($adminEmail2, $adminName2, $row->email, $subject2, $message2);
}
}


This isn't elegant at all but I copied that section directly below it and changed the

$admins = $acl->get_group_objects( 25, 'ARO' );

to

$admins = $acl->get_group_objects( 24, 'ARO' );
(24 returns normal Admins)

So, I end up with;

// get superadministrators id
$admins = $acl->get_group_objects( 25, 'ARO' );
if( empty( $admins['users'] )) {
return;
}
foreach ( $admins['users'] AS $id ) {
$query = "SELECT email, sendEmail"
. "\n FROM #__users"
."\n WHERE id = $id"
;
$database->setQuery( $query );
$rows = $database->loadObjectList();

$row = $rows[0];

if ($row->sendEmail) {
vmMail($adminEmail2, $adminName2, $row->email, $subject2, $message2);
}
}

// get administrators id
$admins = $acl->get_group_objects( 24, 'ARO' );
if( empty( $admins['users'] )) {
return;
}
foreach ( $admins['users'] AS $id ) {
$query = "SELECT email, sendEmail"
. "\n FROM #__users"
."\n WHERE id = $id"
;
$database->setQuery( $query );
$rows = $database->loadObjectList();

$row = $rows[0];

if ($row->sendEmail) {
vmMail($adminEmail2, $adminName2, $row->email, $subject2, $message2);
}
}
[URL=[url="http://www.actiononline.co.nz"]http://www.actiononline.co.nz[/url]]Web Site Design[/URL] | [URL=[url="http://www.actiononline.co.nz/web-design/web-design-wellington.html%5DWeb"]http://www.actiononline.co.nz/web-design/web-design-wellington.html]Web[/url] Design Wellington[/URL]

Quick Reply

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name:
Email:
Verification:
Please leave this box empty:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:
7+4+3:
Shortcuts: ALT+S post or ALT+P preview