WordPress.org

Forums

Simplr Registration Form Plus+
Show custom fields in admin welcome email (4 posts)

  1. Galaxy-Design.co.uk
    Member
    Posted 2 years ago #

    Hello,

    I'm wondering how can I customize email that is sent to me (admin) on new user registration? By default I only receive 'username' and 'email'. I also would like to see some of the Custom Fields that I've created, like Phone Number etc.
    Is that possible?

    Thank you. Very nice plugin by the way, does the job very well.

    http://wordpress.org/extend/plugins/simplr-registration-form/

  2. Arsie Organo
    Member
    Posted 2 years ago #

    have you already sorted this out?

  3. Galaxy-Design.co.uk
    Member
    Posted 2 years ago #

    Hi Arsie,

    Yeah, but I had to add few lines to plugin file (which probably isn`t perfect solution, as these changes will be lost on plugin update and you will have to re-do it again)

    Anyway here it is...

    1.Go to plugin editor,find following file: simplr-registration-form/simplr_form_functions.php

    2.Find following lines:

    function simplr_send_notifications($atts, $data, $passw) {
    	global $simplr_options;
    	$site = get_option('siteurl');
    	$name = get_option('blogname');
    	$user_name = @$data['username'];
    	$email = @$data['email'];
    	$notify = @$atts['notify'];
    	$emessage = @$atts['message'];
    	$headers = "From: $name" . ' <' .get_option('admin_email') .'> ' ."\r\n\\";
    	wp_mail($notify, "A new user registered for $name", "A new user has registered for $name.\r Username: $user_name\r Email: $email \r",$headers);
    	$emessage = $emessage . "\r\r---\r";
    		if(!isset($data['password'])) {
    			$emessage .= "You should login and change your password as soon as possible.\r\r";
    		}

    3. Make the changes (the example is to add First Name and Last name):

    function simplr_send_notifications($atts, $data, $passw) {
    	global $simplr_options;
            $user_firstname = @$data['first_name'];  <-------- ADD LINE TO REGISTER FIELD - FIRST NAME
            $user_lastname = @$data['last_name'];   <-------- ADD LINE TO REGISTER FIELD - LAST NAME
    	$site = get_option('siteurl');
    	$name = get_option('blogname');
    	$user_name = @$data['username'];
    	$email = @$data['email'];
    	$notify = @$atts['notify'];
    	$emessage = @$atts['message'];
    	$headers = "From: $name" . ' <' .get_option('admin_email') .'> ' ."\r\n\\";
    	wp_mail($notify, "A new user registered for $name", "A new user has registered for $name.\r\r Username: $user_name\r\r  Add this line for fields to appear in email ---->First Name: $user_firstname\r\r Last Name: $user_lastname\r <---- \r Email: $email \r",$headers);
    	$emessage = $emessage . "\r\r---\r";
    		if(!isset($data['password'])) {
    			$emessage .= "You should login and change your password as soon as possible.\r\r";
    		}

    So first we`ve registered two fields:
    $user_firstname = @$data['first_name'];
    $user_lastname = @$data['last_name'];

    And then add fields into email itself by adding this:
    First Name: $user_firstname\r\r Last Name: $user_lastname

    I put arrows inside the code for guidance...

    Hope this helps,
    Slava
    web design

  4. jonahnaylor
    Member
    Posted 1 year ago #

    Hi does anyone know if there is a fix for this yet? I have several fields and a couple of pages with different forms on. I need to set the admin notification email to show all the fields of a form when a new user registers. Any help would be much appreciated.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Simplr Registration Form Plus+
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic