MyBB Community Forums

Full Version: How to edit content of email sent to admin upon new resgistration request
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, looking for a way to add new content to the email that is auto-generated and sent to the admin upon a new registration request. At this time what I receive is this:

A new user registered at "HPD Forums".

Informations:
User-ID: ##
Username: Name User
Email Adress: There email
IP Adress: Ip addy


What I would like to do is add from some of the custom fields that I have added to the registration page. For example, Company and if they are a current user of our software checkbox. So it would look something like this:

A new user registered at "HPD Forums".

Informations:
User-ID: ##
Username: Name User
Email Adress: There email
Company: Company they are from
Current HPD user? Yes or No
IP Adress: Ip addy


Our forum URL is: http://hpdforum.caris.com/hpdforum/index.php
Any help would be appreciated. Thanks
No takers? I could really use the help. This a plugin "Email Notification on Registration" created by MyBBoard.de
(2008-11-06, 03:07 PM)blackdragon Wrote: [ -> ]No takers? I could really use the help. This a plugin "Email Notification on Registration" created by MyBBoard.de

Well, after spending a couple of hours sifting through the code and tables on this I did manage to figure out how to alter the content of the email sent to the potential registrant. Thanks anyway.
Hmm.. I'm trying to figure out how to do this. How did you do it?
(2008-12-15, 07:19 PM)bundyxc Wrote: [ -> ]Hmm.. I'm trying to figure out how to do this. How did you do it?

First look in your database for a table with your prefix followed by userfields. Here you will notice that the columns are named fid2, fid3, fid4 and so on. Just add a new field following the naming convention. For example, if your table ends at fid6, add fid7 to represent the new field you want to add or fid8 if you want to add 2 new fields and so on. Next you'll need to edit the plugin file. In your forums directory find the inc/plugins/ directory and open email_new_member.php for editing. You should find the following code.

// Funktionen
function email_new_member()
{
global $mybb, $db, $user_info;

if ($mybb->settings['emailonreg_onoff'] != "no")
{
$query = $db->query("SELECT username, email, regip FROM ".TABLE_PREFIX."users WHERE uid = ".intval($user_info['uid'])."");
$emaildata = $db->fetch_array($query);

my_mail("".$mybb->settings['emailonreg_email']."", "New Registration on \"".$mybb->settings['bbname']."\"", "A new user registered at \"".$mybb->settings['bbname']."\".\n\nInformations:\nUser-ID: ".$user_info['uid']."\nUsername: ".$emaildata['username']."\nEmail Adress: ".$emaildata['email']."\nIP Adress: ".$emaildata['regip']."");
}
}

This is were you need to make your changes. My outgoing email changed to :

function email_new_member()
{
global $mybb, $db, $user_info;

if ($mybb->settings['emailonreg_onoff'] != "no")
{
$query = $db->query("SELECT u.username, u.email, u.regip, f.fid4, f.fid7 FROM ".TABLE_PREFIX."users u, ".TABLE_PREFIX."userfields f WHERE u.uid = ".intval($user_info['uid'])." AND f.ufid = ".intval($user_info['uid'])."");
$emaildata = $db->fetch_array($query);

my_mail("".$mybb->settings['emailonreg_email']."", "New Registration on \"".$mybb->settings['bbname']."\"", "A new user registered at \"".$mybb->settings['bbname']."\".\n\nInformations:\nUser-ID: ".$user_info['uid']."\nUsername: ".$emaildata['username']."\nEmail Adress: ".$emaildata['email']."\nOrganization: ".$emaildata['fid4']."\nCurrent HPD User: ".$emaildata['fid7']."\nIP Adress: ".$emaildata['regip']."");
}
}

You'll have to change yours to reflect your new fields accordingly. Hope this helps. Good luck and let me know if there's anything else.