Custom Fields in CB Registration Admin Email

11 years 1 month ago - 11 years 1 month ago #222514 by Yxos
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:
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:
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.

Yxos
The following user(s) said Thank You: fyistudio, fredbo
The topic has been locked.
9 years 1 month ago #260001 by Patriktx
Replied by Patriktx on topic Custom Fields in CB Registration Admin Email
Hi I tried this using CB 2.0.7 and its not working emails are still standard is there another place to add our custom fields to so we can get a registration email with all the info in it?
The topic has been locked.
9 years 1 month ago #260019 by nant

Patriktx wrote: Hi I tried this using CB 2.0.7 and its not working emails are still standard is there another place to add our custom fields to so we can get a registration email with all the info in it?



PLEASE start a new support thread instead of posting on a 1 year old thread - locking it now.
The topic has been locked.
Moderators: beatnantkrileon
Time to create page: 0.232 seconds

Facebook Twitter LinkedIn