WordPress.org

Support

Support » Plugins and Hacks » Show custom fields in admin welcome email

Show custom fields in admin welcome email

Viewing 3 replies - 1 through 3 (of 3 total)
  • have you already sorted this out?

    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

    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Show custom fields in admin welcome email’ is closed to new replies.