Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2010
    Location
    London
    Posts
    18
    Plugin Contributions
    0

    Default Send additional registration info to admin create account email - create_account.php

    Hi,
    I have added some extra fields to the registration process on my stoer and added the corresponding columns in my db. Everything works very nicely, however I am trying to get the extra data sent to the admin create account email when new users sign up.

    I can see from the emails I am getting that I am hacking the right part of the create_account.php file, I am clearly just not understanding what the code is doing. Here's what I have..

    PHP Code:
    // send additional emails

        
    if (SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO_STATUS == '1' and SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO !='') {

          if (
    $_SESSION['customer_id']) {

            
    $account_query "select customers_firstname, customers_lastname, customers_email_address, customers_telephone, customers_mobile, customers_fax, customers_qualified_unqualified, customers_how_long, customers_academy_details, customers_qualifications, customers_products_used

                                from " 
    TABLE_CUSTOMERS "

                                where customers_id = '" 
    . (int)$_SESSION['customer_id'] . "'";



            
    $account $db->Execute($account_query);

          }

     
    // ######################  ADDITIONAL CUSTOMER INFORMATION SENT TO EMAIL NOTIFICATION #################### //
          
    $extra_info=email_collect_extra_info($name,$email_address,$telephone,$mobile,$qualified,$how_long,$academy_details,$qualifications,$products_used,$fax$account->fields['customers_firstname'] . ' ' $account->fields['customers_lastname'], $account->fields['customers_email_address'], $account->fields['customers_telephone'], $account->fields['customers_mobile'], $account->fields['customers_qualified_unqualified'],  $account->fields['customers_how_long'],  $account->fields['customers_academy_details'],  $account->fields['customers_qualifications'],  $account->fields['customers_products_used'],  $account->fields['customers_fax']);

          
    $html_msg['EXTRA_INFO'] = $extra_info['HTML'];

          if (
    trim(SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO_SUBJECT) != 'n/a'zen_mail(''SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TOSEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO_SUBJECT ' ' EMAIL_SUBJECT,

          
    $email_text $extra_info['TEXT'], STORE_NAMEEMAIL_FROM$html_msg'welcome_extra');

        } 
    //endif send extra emails 

  2. #2
    Join Date
    Aug 2010
    Location
    London
    Posts
    18
    Plugin Contributions
    0

    Default Re: Send additional registration info to admin create account email - create_account.

    Can anyone help me with this? I'm having a little trouble understanding what this code is doing.

    Thanks :)

  3. #3
    Join Date
    Jun 2012
    Posts
    13
    Plugin Contributions
    0

    Default Re: Send additional registration info to admin create account email - create_account.

    Quote Originally Posted by BuddyH View Post
    Can anyone help me with this? I'm having a little trouble understanding what this code is doing.

    Thanks :)
    Hi Buddy, I know it's a while since you posted this, but I just stumbled upon it looking to do the same thing. Did you get it working? You did not say what the problem with it was, I have a limited understanding of php, but I think I can see a potential problem in your code.

    PHP Code:

    $extra_info
    =email_collect_extra_info($name,$email_address,$telephone,$mobile,$qualified,$how_long,$academy_details,$qualifications,$products_used,$fax$account->fields['customers_firstname'] . ' ' $account->fields['customers_lastname'], $account->fields['customers_email_address'], $account->fields['customers_telephone'], $account->fields['customers_mobile'], $account->fields['customers_qualified_unqualified'],  $account->fields['customers_how_long'],  $account->fields['customers_academy_details'],  $account->fields['customers_qualifications'],  $account->fields['customers_products_used'],  $account->fields['customers_fax']); 
    I think the above should be written as

    PHP Code:

    $extra_info
    =email_collect_extra_info($name,$email_address$account->fields['customers_firstname'] . ' ' $account->fields['customers_lastname'], $account->fields['customers_email_address'], $account->fields['customers_telephone'], $account->fields['customers_mobile'], $account->fields['customers_qualified_unqualified'],  $account->fields['customers_how_long'],  $account->fields['customers_academy_details'],  $account->fields['customers_qualifications'],  $account->fields['customers_products_used'],  $account->fields['customers_fax']); 
    I've not tried this with my own code yet but will be looking into it so will check back once I have.
    Last edited by twistafix; 27 Jul 2012 at 03:05 PM. Reason: sp

  4. #4
    Join Date
    Jun 2012
    Posts
    13
    Plugin Contributions
    0

    Default Re: Send additional registration info to admin create account email - create_account.

    Quote Originally Posted by twistafix View Post
    Hi Buddy, I know it's a while since you posted this, but I just stumbled upon it looking to do the same thing. Did you get it working? You did not say what the problem with it was, I have a limited understanding of php, but I think I can see a potential problem in your code.

    PHP Code:

    $extra_info
    =email_collect_extra_info($name,$email_address,$telephone,$mobile,$qualified,$how_long,$academy_details,$qualifications,$products_used,$fax$account->fields['customers_firstname'] . ' ' $account->fields['customers_lastname'], $account->fields['customers_email_address'], $account->fields['customers_telephone'], $account->fields['customers_mobile'], $account->fields['customers_qualified_unqualified'],  $account->fields['customers_how_long'],  $account->fields['customers_academy_details'],  $account->fields['customers_qualifications'],  $account->fields['customers_products_used'],  $account->fields['customers_fax']); 
    I think the above should be written as

    PHP Code:

    $extra_info
    =email_collect_extra_info($name,$email_address$account->fields['customers_firstname'] . ' ' $account->fields['customers_lastname'], $account->fields['customers_email_address'], $account->fields['customers_telephone'], $account->fields['customers_mobile'], $account->fields['customers_qualified_unqualified'],  $account->fields['customers_how_long'],  $account->fields['customers_academy_details'],  $account->fields['customers_qualifications'],  $account->fields['customers_products_used'],  $account->fields['customers_fax']); 
    I've not tried this with my own code yet but will be looking into it so will check back once I have.
    Well, I have tried what I suggested above and the extra field info is not included in the email sent to admin. Just to clarify, the file being edited is

    includes/modules/MY_TEMPLATE/create_account.php

    I also added wholesale_extrafield to the section of code above the part we are talking about, so that it now looks like this

    PHP Code:
    $account_query "select customers_firstname, customers_lastname, customers_email_address, customers_telephone, customers_fax, wholesale_extrafield
                                from " 
    TABLE_CUSTOMERS "
                                where customers_id = '" 
    . (int)$_SESSION['customer_id'] . "'";

            
    $account $db->Execute($account_query); 
    but it makes no difference.

    Does anyone have any ideas how to include the extra information in the email sent to the admin upon account creation?

    Thanks :)

  5. #5
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Send additional registration info to admin create account email - create_account.

    No. There's a lot more to merely using the email_collect_extra_info() function than just stuffing more parameters onto the end of it.

    Try adding a new line like this instead, still in the create_account.php file:
    Code:
          $extra_info=email_collect_extra_info($name,$email_address, $account->fields['customers_firstname'] . ' ' . $account->fields['customers_lastname'], $account->fields['customers_email_address'], $account->fields['customers_telephone'], $account->fields['customers_fax']);
    $extra_info['TEXT'] .= "\n" . 'Wholesale: ' . $account->fields['wholesale_extrafield'];
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Jun 2012
    Posts
    13
    Plugin Contributions
    0

    Default Re: Send additional registration info to admin create account email - create_account.

    Quote Originally Posted by DrByte View Post
    No. There's a lot more to merely using the email_collect_extra_info() function than just stuffing more parameters onto the end of it.

    Try adding a new line like this instead, still in the create_account.php file:
    Code:
          $extra_info=email_collect_extra_info($name,$email_address, $account->fields['customers_firstname'] . ' ' . $account->fields['customers_lastname'], $account->fields['customers_email_address'], $account->fields['customers_telephone'], $account->fields['customers_fax']);
    $extra_info['TEXT'] .= "\n" . 'Wholesale: ' . $account->fields['wholesale_extrafield'];
    DrByte, that worked perfectly, thank you

    I can see from your suggestion where I was going wrong, and also that I need to check the how the functions work before trying to mess with them lol

    Thanks again

 

 

Similar Threads

  1. Replies: 19
    Last Post: 27 Jun 2012, 04:59 AM
  2. v150 Admin create-account email not arriving
    By bluefish1960 in forum Basic Configuration
    Replies: 3
    Last Post: 16 Feb 2012, 11:41 AM
  3. Create Account - Include all fields in admin welcome email
    By adam2020 in forum General Questions
    Replies: 0
    Last Post: 16 Feb 2010, 02:12 AM
  4. How to add referral info to create account email notice?
    By sandratampa in forum General Questions
    Replies: 0
    Last Post: 9 Jan 2010, 08:14 PM
  5. Changing Info Provided to Admin in CREATE ACCOUNT Email
    By toob in forum Basic Configuration
    Replies: 8
    Last Post: 7 May 2007, 03:03 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR