Page 1 of 4

Send custom profile field answers in Admin activation email?

Posted: Sun Sep 06, 2009 4:04 am
by alastair78
I have 5 custom profile fields on my registration page. I need to check these to activate each user. Is there a way to get the users answers to these profile fields emailed to me in the Admin activation email.

Thanks

Re: Send custom profile field answers in Admin activation email?

Posted: Mon Sep 21, 2009 5:35 am
by doday
I really wish someone would have answered this.

I have gotten it to email me when a new user is created using a mod, but can't figure out how to get custom profile fields included in that mod.

Re: Send custom profile field answers in Admin activation email?

Posted: Mon Sep 21, 2009 9:24 am
by alastair78
Yeah me too, I still haven't worked it out

Re: Send custom profile field answers in Admin activation email?

Posted: Mon Sep 21, 2009 11:53 am
by doday
And it should be relatively simple for anyone with some PHP/MySQL/phpBB knowledge to answer... oh well :?

Re: Send custom profile field answers in Admin activation email?

Posted: Mon Sep 21, 2009 1:50 pm
by dellsystem
Actually, this looks to be harder than it might seem :?

The built-in functions for grabbing & showing custom profile field data format it for the template files, so grabbing the data free of processing might be a challenge. If you're interested in looking at this for yourselves, take a look at includes/functions_profile_fields.php. Besides that, an entry would have to be added in includes/ucp/ucp_register and the relevant template variable inserted into language/en/email/admin_activate.txt, but that's simple.

I'm going to be rather busy for the next couple of days, and my knowledge of the v3 custom profile fields system is somewhat lacking, but if no one else is able to make progress on this then I'll try again at this obstacle in a few days. Just make sure to poke me via PM or email in case this slips my mind :)

Good luck

Re: Send custom profile field answers in Admin activation email?

Posted: Tue Oct 06, 2009 1:20 pm
by ntxfdotcom
Was anyone ever able to figure this one out? I added a "recruited by" custom field to my registration and need it to be included in the "admin_notify_registered.txt" email.

Re: Send custom profile field answers in Admin activation email?

Posted: Wed Oct 14, 2009 3:19 pm
by dellsystem
ntxfdotcom wrote:Was anyone ever able to figure this one out? I added a "recruited by" custom field to my registration and need it to be included in the "admin_notify_registered.txt" email.
I don't see an "admin_notify_registered.txt" in the /email/ folder. Is this perhaps a MOD you've installed?

In any case, here's the basic idea:

Open includes/ucp/ucp_register.php
Do a 'find' for the name of the .txt file you want to use. In this example, we'll use 'admin_activate'.

So the first instance of admin_activate in that file shows up in this line:

Code: Select all

							$messenger->template('admin_activate', $row['user_lang']);
A couple of lines later, this line should appear:

Code: Select all

$messenger->assign_vars(array(
Right after that, make a new line and add this:

Code: Select all

								'RECRUITER'		=> request_var('pf_recruiter', ''),
In that .txt file, add:

Code: Select all

This person was recruited by {RECRUITER}
This is assuming that your profile field is named 'recruiter'. Change the code if necessary.

I haven't been able to test this, let me know if there are problems.

Re: Send custom profile field answers in Admin activation email?

Posted: Wed Oct 14, 2009 3:47 pm
by ntxfdotcom
That worked perfectly!! Thank you very much for your response. How would I add their IP address to the same email? I looked and could not figure it out.

Re: Send custom profile field answers in Admin activation email?

Posted: Wed Oct 14, 2009 5:35 pm
by mokus
It works! Thanks!! :^)

But additional text field typed in my (russian) keyboard layout in confirmation email looks like ?????? ??????????? ?????

Dmitriy

Re: Send custom profile field answers in Admin activation email?

Posted: Wed Oct 14, 2009 6:33 pm
by 4_seven
dellsystem wrote:

Code: Select all

    'RECRUITER'        => request_var('pf_recruiter', ''), 
mokus wrote:looks like ?????? ??????????? ?????
Check this out...

Code: Select all

'RECRUITER'        => utf8_normalize_nfc(request_var('pf_recruiter', '', true)), 

Re: Send custom profile field answers in Admin activation email?

Posted: Wed Oct 14, 2009 6:38 pm
by ntxfdotcom
Yes but what about adding their IP address, link to their profile? Or what about sending an email to mods or admins when their is a post awaiting activation? I cant figure them out.

Re: Send custom profile field answers in Admin activation em

Posted: Fri Apr 30, 2010 10:16 am
by Skimble1973
I've got the same problem as alastair78. I want to add some custom profile fields to the txt-file
admin_welcome_inactive.txt

I tried to follow the steps dellsystem decribed (but all I receive is the text I entered in admin_welcome_inactive.txt , but not the content of the fields):

dellsystem wrote:
I don't see an "admin_notify_registered.txt" in the /email/ folder. Is this perhaps a MOD you've installed?

In any case, here's the basic idea:

Open includes/ucp/ucp_register.php
Do a 'find' for the name of the .txt file you want to use. In this example, we'll use 'admin_activate'.

So the first instance of admin_activate in that file shows up in this line:

Code: Select all

							$messenger->template('admin_activate', $row['user_lang']);
A couple of lines later, this line should appear:

Code: Select all

$messenger->assign_vars(array(
Right after that, make a new line and add this:

Code: Select all

								'RECRUITER'		=> request_var('pf_recruiter', ''),
In that .txt file, add:

Code: Select all

This person was recruited by {RECRUITER}
This is assuming that your profile field is named 'recruiter'. Change the code if necessary.

I haven't been able to test this, let me know if there are problems.

I've only changed
admin_welcome_inactive.txt
and
includes/ucp/ucp_register.php as descibed by desssystem.
What else do I have to do???
Please give me a hint! :|

Re: Send custom profile field answers in Admin activation em

Posted: Tue May 04, 2010 12:27 pm
by Skimble1973
dellsystems description finally works ... (I just didn't use capital letters before - my fault!).

But I still have got a problem:

One of my costum profile fields during registration is the date of birth. This field does not appear in the email message while the other fields do!

What do I have to change concerning that field??? :?:

Re: Send custom profile field answers in Admin activation em

Posted: Sun Feb 27, 2011 5:40 pm
by KenJr
I am having sort of the same issue. I have the username, email and IP coming in the admin emails. I have a custom field in the registration page that is required that is a boolean (Yes/No).

How can I get the answer to that question to show in the admin email??

Re: Send custom profile field answers in Admin activation em

Posted: Wed Mar 09, 2011 4:42 am
by dellsystem
KenJr wrote:I am having sort of the same issue. I have the username, email and IP coming in the admin emails. I have a custom field in the registration page that is required that is a boolean (Yes/No).

How can I get the answer to that question to show in the admin email??
It should be the same sort of thing as what I posted above. Just change the name to reflect the name of the field. Do you have a link to your site?