I needed to show add a custom field in the CB registration form, and have it included in the automated email sent to the administrator.
I then found this 4 year old post which matches my need 100%, but for an outdated release. :
www.joomlapolis.com/forum/42-usability/70283-custom-fields-in-cb-registration-a-admin-email
To my surprise, it led to an instant solution with the current version 1.9 on a joomla! 2.5.9, with only a few changes:
I dare to quote a lot of the excellent phrasing from that post in the following.
First; Jot down the Field Name of your custom field as it appears after you type it in. Community builder should add a cb_ prefix to the name. This will be the name as it appears in the database, and you will need it for the following steps. E.g. "Yourfield" will become "cb_yourfield".
You then need to backup and modify the original version of
components/com_comprofiler/plugin/language/default_language/default_language.php.
(If you use a diffenerent language, you need to work on the language pack. E.g. if you run Danish, you need to modify
components/com_comprofiler/plugin/language/danish/danish.php.)
Around line 165, find the following code:
Code:
DEFINE ('_UE_REG_ADMIN_PA_MSG','A new user has registered at [SITEURL] and requires approval.\n'
.'This email contains their details\n\n'
.'Name - [NAME]\n'
.'E-mail - [EMAILADDRESS]\n'
.'Username - [USERNAME]\n\n\n'
.'Please do not respond to this message as it is automatically generated and is for informational purposes only.\n');
Add your own field(s) in a line below the line with "USERNAME".
Like:
Code:
DEFINE ('_UE_REG_ADMIN_PA_MSG','A new user has registered at [SITEURL] and requires approval.\n'
.'This email contains their details\n\n'
.'Name - [NAME]\n'
.'E-mail - [EMAILADDRESS]\n'
.'Username - [USERNAME]\n\n'
.'CustomFieldName - [cb_yourfield]\n\n\n'
.'Please do not respond to this message as it is automatically generated and is for informational purposes only.\n');
Keep in mind that the trailing n’s represent space lines, so adjust those accordingly if you want a neat email.
Repeat the change on '_UE_REG_ADMIN_MSG' around line 172.