Author |
Message |
sak
Worker
![Worker Worker](modules/Forums/images/ranks/3stars.gif)
![](modules/Forums/images/avatars/0cddf1ff43222768be81b.jpg)
Joined: Jul 06, 2005
Posts: 172
|
Posted:
Mon Sep 14, 2009 4:54 pm |
|
I'm running the latest RN -- 2.30.02. Loving it!
I've come across the need to notify myself of new account creations. I posted a thread in the suggestions for later revisions of RN for this: http://www.ravenphpscripts.com/postt18114.html
What I'm trying to accomplish is to be able have sent automatically when someone registers an email containing not only their username and IP, but their real name and other fields -- my specific need right now Real name, email, and 2 custom fields under RNYA. Other people may have other needs, which they could adapt.
I'm not a programmer, although I can get in, hack things a little bit, and most of the time understand what's going on. I'm just not familiar with php enough yet to do it all myself
I'm looking at the /modules/Your_Account/public/new_finish.php file (starting line 216):
Code: if ($ya_config['sendaddmail'] == 1 AND $ya_config['servermail'] == 1) {
if ($ya_config['requireadmin'] == 1) {
$subject = $sitename . ' - ' . _MEMAPL;
$message = $ya_username . ' ' . _YA_APLTO . ' ' . $sitename . ' ' . _YA_FROM . ' ' . $ip . "\r\n";
} elseif ($ya_config['useactivate'] == 1) {
$subject = $sitename . ' - ' . _MEMACT;
$message = $ya_username . ' ' . _YA_APLTO . ' ' . $sitename . ' ' . _YA_FROM . ' ' . $ip . "\r\n";
} elseif ($ya_config['useactivate'] == 0) {
$subject = $sitename . ' - ' . _MEMADD;
$message = $ya_username . ' ' . _YA_ADDTO . ' ' . $sitename . ' ' . _YA_FROM . ' ' . $ip . "\r\n";
}
$message .= '-----------------------------------------------------------' . "\r\n";
$message .= _YA_NOREPLY;
ya_mail($adminmail, $subject, $message, $ya_user_email);
}
|
I'm assuming I would have to define some things at the top? I would also like it to send to a different address than $adminmail. Can I just hardcode my desired email in there, or can I create a new variable (is that what they're called) and define it at the top?
Hopefully what I'm trying to accomplish isn't too hard. I'm sure other people might find it useful in the future if we can figure out a mod for this. One of the useful things is to be able to bring these emails into a third-party email parser for instant live parsing of user data. |
_________________ www.ICarry.org
www.GunOwnersFellowship.com |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
kguske
Site Admin
![](modules/Forums/images/avatars/41f0b40a419280935f3a0.gif)
Joined: Jun 04, 2004
Posts: 6437
|
Posted:
Tue Sep 15, 2009 12:56 pm |
|
We're a little busy with the release right now, but this is something I'm interested in, too. Let me check later this week... |
_________________ I search, therefore I exist...
Only registered users can see links on this board! Get registered or login! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
sak
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Sep 20, 2009 7:18 pm |
|
I gotta get this goin this week somehow, because I have a show on Saturday and Sunday and I'll need the emails being dumped into my parser.
Do you think you could help me with a quick hack to get the few fields I need in there for now and then if it's something you guys decide is worthwhile it can always be coded into the GUI later? I'm getting desperate ![Very Happy](modules/Forums/images/smiles/icon_biggrin.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jakec
Site Admin
![](modules/Forums/images/avatars/502a2d1345d88a86ddb4a.png)
Joined: Feb 06, 2006
Posts: 3048
Location: United Kingdom
|
Posted:
Sun Sep 20, 2009 11:39 pm |
|
If you want a quick turnaround you might want to post in the for hire forum. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
sak
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Sep 21, 2009 9:46 am |
|
Ah, never noticed that forum before Thanks |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
kguske
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Sep 21, 2009 11:12 am |
|
What if we included all fields required for registration (except the password, of course) in the admin notification?
Are the real name and 2 custom fields required for registration? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
sak
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Sep 21, 2009 3:39 pm |
|
yes, the fields I need are all required at registration |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
kguske
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Sep 21, 2009 5:14 pm |
|
How about this: display all fields used for registration?
If so, in modules/Your_Account/public/new_finish.php, after
Code: if ($ya_config['sendaddmail'] == 1 AND $ya_config['servermail'] == 1) {
if ($ya_config['requireadmin'] == 1) {
$subject = $sitename . ' - ' . _MEMAPL;
$message = $ya_username . ' ' . _YA_APLTO . ' ' . $sitename . ' ' . _YA_FROM . ' ' . $ip . "\r\n";
} elseif ($ya_config['useactivate'] == 1) {
$subject = $sitename . ' - ' . _MEMACT;
$message = $ya_username . ' ' . _YA_APLTO . ' ' . $sitename . ' ' . _YA_FROM . ' ' . $ip . "\r\n";
} elseif ($ya_config['useactivate'] == 0) {
$subject = $sitename . ' - ' . _MEMADD;
$message = $ya_username . ' ' . _YA_ADDTO . ' ' . $sitename . ' ' . _YA_FROM . ' ' . $ip . "\r\n";
}
|
insert:
Code: // Add registration fields to admin notification
$message .= _NICKNAME . ': ' . $ya_username . "\r\n";
if ($ya_config['userealname'] > 1) $message .= _UREALNAME . ': ' . $ya_realname . "\r\n";
$message .= _EMAIL . ': ' . $ya_user_email . "\r\n";
// Add custom registration fields to admin notification
$result = $db->sql_query('SELECT * FROM ' . $user_prefix . '_users_fields WHERE (need = \'2\') OR (need = \'3\') ORDER BY pos');
while ($sqlvalue = $db->sql_fetchrow($result)) {
$t = $sqlvalue['fid'];
$name_exit = ya_GetCustomFieldDesc($sqlvalue['name']);
$message .= $name_exit . ': ' . $nfield[$t] . "\r\n";
}
if ($ya_config['usefakeemail'] > 1) $message .= _UFAKEMAIL . ': ' . $femail . "\r\n";
if ($ya_config['usewebsite'] > 1) $message .= _YOURHOMEPAGE . ': ' . $user_website . "\r\n";
if ($ya_config['useinstantmessaim'] > 1) $message .= _YAIM . ': ' . $user_aim . "\r\n";
if ($ya_config['useinstantmessicq'] > 1) $message .= _YICQ . ': ' . $user_icq . "\r\n";
if ($ya_config['useinstantmessmsn'] > 1) $message .= _YMSNM . ': ' . $user_msnm . "\r\n";
if ($ya_config['useinstantmessyim'] > 1) $message .= _YYIM . ': ' . $user_yim . "\r\n";
if ($ya_config['uselocation'] > 1) $message .= _YLOCATION . ': ' . $user_from . "\r\n";
if ($ya_config['useoccupation'] > 1) $message .= _YOCCUPATION . ': ' . $user_occ . "\r\n";
if ($ya_config['useinterests'] > 1) $message .= _YINTERESTS . ': ' . $user_interests . "\r\n";
if ($ya_config['usenewsletter'] > 1) $message .= _RECEIVENEWSLETTER . ': ' . $newsletter . "\r\n";
if ($ya_config['useviewemail'] > 1) $message .= _ALWAYSSHOWEMAIL . ': ' . $user_viewemail . "\r\n";
if ($ya_config['usehideonline'] > 1) $message .= _HIDEONLINE . ': ' . $user_allow_viewonline . "\r\n";
if ($ya_config['usesignature'] > 1) $message .= _SIGNATURE . ': ' . $user_sig . "\r\n";
if ($ya_config['useextrainfo'] > 1) $message .= _EXTRAINFO . ': ' . $bio . "\r\n";
|
just before:
Code: $message .= '-----------------------------------------------------------' . "\r\n";
$message .= _YA_NOREPLY;
ya_mail($adminmail, $subject, $message, $ya_user_email);
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
kguske
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Sep 21, 2009 5:16 pm |
|
Be aware: I did VERY MINIMAL testing on this (i.e. 1 simple test). Use this at your own risk... (note that this is after everything else is done, so the real risk is that you won't get a notification email, and if it crashes, you might expose your root path). |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
sak
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Sep 21, 2009 8:52 pm |
|
Thanks so much, kguske
Just installed it and it works great. I left out the if statements only because I don't plan on using any of those, but I understand exactly what you're doing. Thanks so much!! I'm going to put a shout out for the RavenNuke team! |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
sak
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Sep 22, 2009 11:57 am |
|
If I wanted the email to use "User:" instead of "Nickname:" (I think two fields with *name in them is causing trouble).
Would I change:
Code: $message .= _NICKNAME . ': ' . $ya_username . "\r\n";
|
to
Code: $message .= User': ' . $ya_username . "\r\n";
|
wasn't sure about the syntax. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
kguske
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Sep 22, 2009 12:12 pm |
|
The _NICKNAME constant is the same one used for registration, so if you want to be consistent, you could simply change the value of _NICKNAME in your language file. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
sak
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Sep 22, 2009 1:12 pm |
|
Yeah I changed that. I will have to use just "user" for the email though because of the *name problem with the parser. Does the above syntax look OK, or do I need spaces or more ' or something?
I made a small donation for all the help you've given me. If everyone does the same we can keep this place runnin ![Smile](modules/Forums/images/smiles/icon_smile.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
kguske
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Sep 22, 2009 1:16 pm |
|
The to should be:
Code: $message .= 'User: ' . $ya_username . "\r\n";
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
kguske
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Sep 26, 2009 11:46 pm |
|
Anyone have issues with this being added to RN 2.4? I believe it would be useful and not cause any negative impact. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
Site Admin/Owner
![](modules/Forums/images/avatars/45030c033f18773153cd2.gif)
Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Sun Sep 27, 2009 12:35 am |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
sak
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Mar 24, 2010 3:20 pm |
|
It has worked out fabulously for me. We've used it to integrate our email system in with our user account system. Talk about making things easy!
Ironically, we're switching over to a new email system that is much more advanced, costs 10 times what the first one does, and yet it doesn't have an email parser. So now we have to API something to do this. I may need to hire someone to do that as well ![Surprised](modules/Forums/images/smiles/icon_surprised.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|