Results 1 to 10 of 10
  1. #1
    Join Date
    Feb 2009
    Location
    Sydney, Australia
    Posts
    43
    Plugin Contributions
    0

    Default Email notification if a customer makes a change to their details?

    Is there any way to be notified by email when a customer makes a change to any of their contact or address details?

    I am currently running two databases one for offline sales an one for online (obviously zencart) I am not yet ready to move the offline database online so I would like to be notified about any contact detail changes made by my customers online.

    Thanks

    Sam

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Email notification if a customer makes a change to their details?

    This facility doesn't exist in Zen Cart's core code so you would need to build it. There is a zen_mail function that would make this easier than it might otherwise be, so the tricky bit would be detecting the changes.

    A better approach might be to develop reports that run daily or weekly and return any changes to the customer or address_book tables, as these are date stamped each time there's a change.

    Both of these options though would require some programming skills and a fairly good kowledge of the innards of Zen Cart.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Feb 2009
    Location
    Sydney, Australia
    Posts
    43
    Plugin Contributions
    0

    Default Re: Email notification if a customer makes a change to their details?

    Thanks kuroi,

    Where would I start? I am a beginner at php but slowly getting my head around it..

    I was thinking something simple like:

    Code:
    $email_message = 'Address change:' . "\n\n";
    $email_message .= 'Customer ID:' . $customer_id . "\n";
    $email_message .= 'Customer:' . $customers_firstname . ' ' . $lastname . "\n";
    
      tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, 'Address change', $email_message, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
    I tried putting it under this line:
    Code:
    <?php if ($messageStack->size('addressbook') > 0) echo $messageStack->output('addressbook'); ?>
    in address_book_process.php but doesn't seem to work, any suggestions?

    Thanks Sam

  4. #4
    Join Date
    Feb 2009
    Location
    Sydney, Australia
    Posts
    43
    Plugin Contributions
    0

    Default Re: Email notification if a customer makes a change to their details?

    Does anyone know of a good place to start, either to have an email notification or daily report of customer details changes?

    Thanks

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Email notification if a customer makes a change to their details?

    NOTE: tep_ is a prefix for osC and not for Zen Cart ...

    If you look in the /includes/modules/pages/account_edit/header_php.php you will see where updates are made that indicate a change has happened to the account around the lines:
    Code:
        $sql = "UPDATE " . TABLE_CUSTOMERS_INFO . "
                SET    customers_info_date_account_last_modified = now()
                WHERE  customers_info_id = :customersID";
    
        $sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer');
    
        $db->Execute($sql);
    You could add your email code after that ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  6. #6
    Join Date
    Feb 2009
    Location
    Sydney, Australia
    Posts
    43
    Plugin Contributions
    0

    Default Re: Email notification if a customer makes a change to their details?

    Thanks for your reply,

    now sure exactly how to use the zen_mail command,

    would the script be:

    Code:
    $email_message .= 'Customer:' . $customers_firstname . ' ' . $customers_lastname . "\n";
    
      zen_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, 'Address change', $email_message, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
    or even easier:

    Code:
    $email_message .= 'Customer:' . $customers_firstname . ' ' . $customers_lastname . "\n";
    
       zen_mail( "samueljohnstone####################", "$email_message");
    Thanks so much for your help. I'm a little bit lost here. If you could give me an example of the code already in zen cart that would help heaps.

    Thanks

    Sam


  7. #7
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Email notification if a customer makes a change to their details?

    If you use the developers tool kit (Admin > Tools > Developers Tool Kit) to search on "zen_mail" (pop it in the last input field, select "All Files - Catalog/Admin" and press search. Then you'll find all uses of this function.

    There's a FAQ on using the tool kit.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  8. #8
    Join Date
    Feb 2009
    Location
    Sydney, Australia
    Posts
    43
    Plugin Contributions
    0

    Default Re: Email notification if a customer makes a change to their details?

    Hi Guys,

    I have spent hours on this an still can't seem to work it out.

    I am a poor beginner, but are willing to pay anyone $US15 via Paypal to show me how to do this.

    Basically I need an email sent to me when ever a customer makes a change to any of their details under their account section, ie,
    * View or change my account information.
    * View or change entries in my address book.
    * Subscribe or unsubscribe from newsletters.
    * View or change my product notification list.

    I also need to know what the change is.

    My email address is samueljohnstone######################

    Sam

  9. #9
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Email notification if a customer makes a change to their details?

    There are two files to update about customer information ...

    The first is the Customer Info in:
    /includes/modules/pages/account_edit/header_php.php

    Find the line:
    Code:
        $db->perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', $where_clause);
    and change to read:
    Code:
        $db->perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', $where_clause);
    
    // send email when edited
          zen_mail('', SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO, 'Customer Account Updates',
          'Text Message about customer has updated customer info for account # ' . $_SESSION['customer_id'] . ' ' . $firstname . ' ' . $lastname, STORE_NAME, EMAIL_FROM);
    The second is the Customer Address Book in:
    /includes/modules/pages/address_book_process/header_php.php

    Find the line:
    Code:
          $db->perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', $where_clause);
    and change to read:
    Code:
          $db->perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', $where_clause);
    
    // send email when edited
          zen_mail('', SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO, 'Customer Account Updates',
          'Text Message about customer has updated address book for account # ' . $_SESSION['customer_id'] . ' ' . $firstname . ' ' . $lastname, STORE_NAME, EMAIL_FROM);
    You can change the:
    SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO

    to be a particular email address or use the one set up in your email settings ...

    See if that helps to get you started ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  10. #10
    Join Date
    Apr 2009
    Location
    Athens, Europe
    Posts
    125
    Plugin Contributions
    0

    Default Re: Email notification if a customer makes a change to their details?

    It was very helpful, thank you indeed.

    Kind regards,
    orange_juice

 

 

Similar Threads

  1. re; Adding email advice, after a customer makes a purchase
    By HeyIts007 in forum Managing Customers and Orders
    Replies: 6
    Last Post: 23 Dec 2012, 11:46 AM
  2. customer's order email notification footer
    By george_usa in forum Managing Customers and Orders
    Replies: 2
    Last Post: 3 Jan 2011, 03:33 AM
  3. Email notification of customer address change
    By netmeg in forum Managing Customers and Orders
    Replies: 1
    Last Post: 27 Feb 2009, 12:33 AM
  4. Can customer's update their own email??
    By drbyday in forum Managing Customers and Orders
    Replies: 1
    Last Post: 12 Feb 2009, 09:21 PM
  5. New customer email notification
    By mpence in forum General Questions
    Replies: 4
    Last Post: 13 Jun 2007, 04:52 PM

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