Send custom profile field answers in Admin activation email?

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Anti-Spam Guide
alastair78
Registered User
Posts: 13
Joined: Tue Aug 08, 2006 9:14 am

Send custom profile field answers in Admin activation email?

Post by alastair78 » Sun Sep 06, 2009 4:04 am

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

User avatar
doday
Registered User
Posts: 11
Joined: Mon Sep 21, 2009 5:33 am
Location: Northwest Indiana
Contact:

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

Post by doday » Mon Sep 21, 2009 5:35 am

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.

alastair78
Registered User
Posts: 13
Joined: Tue Aug 08, 2006 9:14 am

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

Post by alastair78 » Mon Sep 21, 2009 9:24 am

Yeah me too, I still haven't worked it out

User avatar
doday
Registered User
Posts: 11
Joined: Mon Sep 21, 2009 5:33 am
Location: Northwest Indiana
Contact:

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

Post by doday » Mon Sep 21, 2009 11:53 am

And it should be relatively simple for anyone with some PHP/MySQL/phpBB knowledge to answer... oh well :?

User avatar
dellsystem
Former Team Member
Posts: 3879
Joined: Sat Apr 09, 2005 8:54 pm
Location: Montreal
Name: Wendy
Contact:

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

Post by dellsystem » Mon Sep 21, 2009 1:50 pm

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
Former moderator and website team member | My MODs, and more (GitHub)

User avatar
ntxfdotcom
Registered User
Posts: 6
Joined: Fri Sep 04, 2009 7:35 pm
Location: Dallas, Texas
Contact:

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

Post by ntxfdotcom » Tue Oct 06, 2009 1:20 pm

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.

User avatar
dellsystem
Former Team Member
Posts: 3879
Joined: Sat Apr 09, 2005 8:54 pm
Location: Montreal
Name: Wendy
Contact:

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

Post by dellsystem » Wed Oct 14, 2009 3:19 pm

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.
Former moderator and website team member | My MODs, and more (GitHub)

User avatar
ntxfdotcom
Registered User
Posts: 6
Joined: Fri Sep 04, 2009 7:35 pm
Location: Dallas, Texas
Contact:

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

Post by ntxfdotcom » Wed Oct 14, 2009 3:47 pm

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.

mokus
Registered User
Posts: 2
Joined: Wed Oct 14, 2009 11:59 am

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

Post by mokus » Wed Oct 14, 2009 5:35 pm

It works! Thanks!! :^)

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

Dmitriy

User avatar
4_seven
I've Been Banned!
Posts: 5155
Joined: Wed Apr 30, 2008 1:41 am

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

Post by 4_seven » Wed Oct 14, 2009 6:33 pm

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)), 
Current Mods | Mod Base | php(BB) programming | No help via PM

User avatar
ntxfdotcom
Registered User
Posts: 6
Joined: Fri Sep 04, 2009 7:35 pm
Location: Dallas, Texas
Contact:

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

Post by ntxfdotcom » Wed Oct 14, 2009 6:38 pm

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.

Skimble1973
Registered User
Posts: 2
Joined: Fri Apr 30, 2010 7:02 am

Re: Send custom profile field answers in Admin activation em

Post by Skimble1973 » Fri Apr 30, 2010 10:16 am

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! :|

Skimble1973
Registered User
Posts: 2
Joined: Fri Apr 30, 2010 7:02 am

Re: Send custom profile field answers in Admin activation em

Post by Skimble1973 » Tue May 04, 2010 12:27 pm

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??? :?:

User avatar
KenJr
Registered User
Posts: 18
Joined: Fri Jan 06, 2006 6:01 pm

Re: Send custom profile field answers in Admin activation em

Post by KenJr » Sun Feb 27, 2011 5:40 pm

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??

User avatar
dellsystem
Former Team Member
Posts: 3879
Joined: Sat Apr 09, 2005 8:54 pm
Location: Montreal
Name: Wendy
Contact:

Re: Send custom profile field answers in Admin activation em

Post by dellsystem » Wed Mar 09, 2011 4:42 am

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?
Former moderator and website team member | My MODs, and more (GitHub)

Locked

Return to “[3.0.x] MOD Requests”