*

hariom singh

  • **
  • 22 posts
adding phone number in admin email template
« on: December 15, 2021, 01:52:17 PM »
 I want to include the phone number in the email template send to admin when a new user is registered I have added phone field in the register page. But how to display it in the email. Can you tell me which file has to be modified.

*

MB Themes

Re: adding phone number in admin email template
« Reply #1 on: December 15, 2021, 05:45:33 PM »
This field is not in list of keywords , so until it is added in core, it will not work.
Maybe it could via filters
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

hariom singh

  • **
  • 22 posts
Re: adding phone number in admin email template
« Reply #2 on: December 15, 2021, 05:56:51 PM »
Thank you for the reply. Can you tell me if there is any plugin or step to include phone number in email template

*

MB Themes

Re: adding phone number in admin email template
« Reply #3 on: December 17, 2021, 02:24:13 PM »
You will need to do such mod.
It should be possible.

Code: [Select]
    $body = osc_apply_filter('email_admin_user_regsitration_description_after', osc_mailBeauty(osc_apply_filter('email_description', osc_apply_filter('email_admin_user_regsitration_description', $content['s_text'], $user)), $words), $user);

I would try something like that (but keep in mind finishing and testing will be on you):
Code: [Select]
function xy_phone_to_mail($body) {
  $phone = Params::getParam('sPhone');
  return str_replace('{PHONE_NUMBER}', $phone, $body);
}

osc_add_filter('email_admin_user_regsitration_description_after', 'xy_phone_to_mail');

It is not clear if sPhone param really exists there. If no, identify user ID from list of params, get user object and phone from there.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots