kenny44 Posted December 1, 2004 Share Posted December 1, 2004 Hi Guys - I need some help really quickly to meet a deadline. I have installed the "Control Login" contribution. That all works fine. What I need to happen is when the admin clicks on the green light beside the users account to activate it, the user gets sent an email letting them know its been activated. I have in admin/includes/functions/general.php : // Customers Status - fixed version function tep_set_customers_status($customers_id, $customers_status) { if ($customers_status == '1') { tep_mail('', ***HELP*** , 'Account Activated', 'Your account has been activated', STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, ''); return tep_db_query("update " . TABLE_CUSTOMERS . " set customers_status = '1' WHERE customers_id = '" . $customers_id . "'"); } elseif ($customers_status == '0') { return tep_db_query("update " . TABLE_CUSTOMERS . " set customers_status = '0' WHERE customers_id = '" . $customers_id . "'"); } else { return -1; } } Obviously, where I have ***HELP*** - is where i'm stuck. The customers email address needs to go in there, but im not sure how to retrieve it. Any help greatly appreciated. Cheers, Ken Link to comment Share on other sites More sharing options...
kenny44 Posted December 1, 2004 Author Share Posted December 1, 2004 please? Link to comment Share on other sites More sharing options...
rerbe Posted December 4, 2004 Share Posted December 4, 2004 Have you had any luck with this as I need the same feature, I asked the creator and no luck as yet?? The solution is never too far away ... Link to comment Share on other sites More sharing options...
rerbe Posted December 9, 2004 Share Posted December 9, 2004 Any news on this one yet?? The solution is never too far away ... Link to comment Share on other sites More sharing options...
djenniex Posted December 9, 2004 Share Posted December 9, 2004 This is one of two things you could do. 1. Create a new function in admin/includes/functions/general.php file that will return a customers email address based on customer_id function tep_customers_email($customers_id) { $customers = tep_db_query("select customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customers_id . "'"); $customers_values = tep_db_fetch_array($customers); return $customers_values['customers_email_address']; } 2. Just use the sql query above in your function So your function could resemble function tep_set_customers_status($customers_id, $customers_status) { if ($customers_status == '1') { tep_mail(tep_customers_name($customers_id), tep_customers_email($customers_id), 'Account Activated', 'Your account has been activated', STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, ''); return tep_db_query("update " . TABLE_CUSTOMERS . " set customers_status = '1' WHERE customers_id = '" . $customers_id . "'"); } elseif ($customers_status == '0') { return tep_db_query("update " . TABLE_CUSTOMERS . " set customers_status = '0' WHERE customers_id = '" . $customers_id . "'"); } else { return -1; } } Link to comment Share on other sites More sharing options...
rerbe Posted December 10, 2004 Share Posted December 10, 2004 Cheers for that one djenniex, I will try this today. The solution is never too far away ... Link to comment Share on other sites More sharing options...
rerbe Posted December 10, 2004 Share Posted December 10, 2004 Great! Works a treat, thanks for that very much apreciated. The solution is never too far away ... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.