Ok here comes a short summary on how to edit the mail to include the new contact details.
In the function _sendMail(&$user, $password) in the controller of com_user is where you make almost all the changes.
Let's say you added the field 'phone'. Then you will need to fetch the phone and store it in a variable just like is done in this function with the name, username and email. It would look something like this:
Code:
$phone = $user->get('phone');
After that you will need to add the $phone variable to the sprintf call of the message which is created at
Code:
if ( $useractivation == 1 ){
$message = sprintf ( JText::_( 'SEND_MSG_ACTIVATE' ), $name, $sitename, $siteURL."index.php?option=com_user&task=activate&activation=".$user->get('activation'), $siteURL, $username, $password);
} else {
$message = sprintf ( JText::_( 'SEND_MSG' ), $name, $sitename, $siteURL);
}
So the message assignment part would look something like this when adding the field to the activation message for example:
Code:
$message = sprintf ( JText::_( 'SEND_MSG_ACTIVATE' ), $name, $sitename, $siteURL."index.php?option=com_user&task=activate&activation=".$user->get('activation'), $siteURL, $username, $password, $phone);
Now, adding this does not alone change anything because you will also need to change the SEND_MSG_ACTIVATE and the SEND_MSG strings of the com_user language file. In those language rows you will have to add atleast one %s sign in their message since this %s sign is what will be changed into the phone variable by the sprintf call.
Finally, if you want the details to also be sent to the admin, you will also need to to the same changes to the SEND_MSG_ADMIN row, adding the variable to the sprintf call and adding the %s token in the language row.