Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Enable/Disable Profile Modified Email from Admin

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 05-10-2003, 09:31 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default Enable/Disable Profile Modified Email from Admin

This is a mod beyond the reach of my current abilites with X-Cart and could really use some assistance.

I would like to be able to have a check box in the admin side of the Modify User profile. The box would be checked by default to notify the customer of changes to their profile.

I need the option to uncheck the box so that when I do annoying little modifications, like capitalising Street Names or correcting Phone Numbers the customer is not bombarded with emails.

I'm sure a lot of people would find this to be a useful mod. If it already exists please tell me. I searched and searched but was unable to turn anything up.

TIA
Reply With Quote
  #2  
Old 05-12-2003, 09:01 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

Patch for the database to make the option appear in the general settings:

Code:
INSERT INTO xcart_config VALUES ('modify_emails', 'Modification emails sent', 'Y', 'General', 1000, 'Checkbox');

Then amend include/register.php (version 3.3.5 - line 146
change:

Code:
func_send_mail($newuser_info["email"], "mail/profile_modified_subj.tpl", "mail/profile_modified.tpl", $config["Company"]["users_department"], false); # # Send mail to customers department # func_send_mail($config["Company"]["users_department"], "mail/profile_admin_modified_subj.tpl", "mail/profile_admin_modified.tpl", $newuser_info["email"], true);

to:
Code:
if ($config["General"]["modify_emails"]=="Y"){ func_send_mail($newuser_info["email"], "mail/profile_modified_subj.tpl", "mail/profile_modified.tpl", $config["Company"]["users_department"], false); # # Send mail to customers department # func_send_mail($config["Company"]["users_department"], "mail/profile_admin_modified_subj.tpl", "mail/profile_admin_modified.tpl", $newuser_info["email"], true); }

howzat?
__________________
ex x-cart guru
Reply With Quote
  #3  
Old 05-12-2003, 09:06 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

Funky Dunk.

INSERT INTO xcart_config VALUES ('modify_emails', 'Modification emails sent', 'Y', 'General', 1000, 'Checkbox');

General should be in commas.

I do believe I owe you a beer or two.

Drop me an email the next time you are in Canada.

Reply With Quote
  #4  
Old 06-05-2003, 02:47 AM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default

And then edit the template to include another checkbox???

hopefully coz I can't see anything appear at the bottom of the general settings page
Reply With Quote
  #5  
Old 06-05-2003, 03:15 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

If you ran the insert statement on your dbase, the checkbox should automatically appear.
Reply With Quote
  #6  
Old 06-05-2003, 03:55 AM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default

Ahhh just tried it on a different version (3.3.5) and it worked but in 3.3.3 it doesn't which was the one I wanted to do it on (v.heavy mods so not safe to upgrade).

Anyone know how to do it in 3.3.3 ????
Reply With Quote
  #7  
Old 12-14-2003, 03:27 PM
  BoomBoomBap's Avatar 
BoomBoomBap BoomBoomBap is offline
 

Senior Member
  
Join Date: Nov 2002
Location: San Francisco
Posts: 184
 

Default

I've got this working in 3.4.10
Here are the changes:

Patch for the database to make the option appear in the general settings:
Code:
INSERT INTO xcart_config VALUES ('modify_emails', 'Modification emails sent', 'Y', 'General', 1000, 'Checkbox');

Then amend include/register.php (version 3.4.10 - line 19

Original
Code:
# # Send mail to registered user (do not send to anonymous) # if(!$anonymous_user) if ($usertype=="B") func_send_mail($email, "mail/signin_notification_subj.tpl", "mail/signin_partner_notif.tpl", $config["Company"]["users_department"], false); else func_send_mail($email, "mail/signin_notification_subj.tpl", "mail/signin_notification.tpl", $config["Company"]["users_department"], false); # # Send mail to customers department # if(!$anonymous_user) func_send_mail($config["Company"]["users_department"], "mail/signin_admin_notif_subj.tpl", "mail/signin_admin_notification.tpl", $email, true);

New
Code:
# # Send mail to registered user (do not send to anonymous) # if ($config["General"]["modify_emails"]=="Y"){ if(!$anonymous_user) if ($usertype=="B") func_send_mail($email, "mail/signin_notification_subj.tpl", "mail/signin_partner_notif.tpl", $config["Company"]["users_department"], false); else func_send_mail($email, "mail/signin_notification_subj.tpl", "mail/signin_notification.tpl", $config["Company"]["users_department"], false); # # Send mail to customers department # if(!$anonymous_user) func_send_mail($config["Company"]["users_department"], "mail/signin_admin_notif_subj.tpl", "mail/signin_admin_notification.tpl", $email, true); }

Once this mod is implemented, you will find a new checkbox at the bottom of General Settings in the Admin area. Check the box to enable notifications, leave empty to disable them.

Note: the change to register.php is just adding the "if" statement.

What an amazingly simple and effective mod. Thanks !
__________________
Site 1 > XCART LIVE 3.4.12

Site 2 > XCART LIVE 4.0.17
Reply With Quote
  #8  
Old 05-30-2004, 11:34 AM
 
nerd luv nerd luv is offline
 

Advanced Member
  
Join Date: Jun 2003
Location: California, USA
Posts: 58
 

Default 3.4.14

I've got a fresh install of 3.4.14 and neither version of the mod worked for me. The checkbox shows up, but unchecking (or checking) it still results in me receiving e-mails everytime a profile is modified.

Has anyone found a way to use this for 3.4.14? Thank you!
__________________
Always happy to Paypal over some money for X-Cart solutions. I need to get this store running! Help!
--Testing 3.5.8, heavily modified, Linux, Apache 1.3.31, PHP 4.3.4--
Reply With Quote
  #9  
Old 05-31-2004, 05:03 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

Nerd Luv,

Works fine on my 3.4.14 site. Perhapsyou should post your code so we can see what the problem is.

This is certainly one for Custom Mods (moderators, hint hint)!
Reply With Quote
  #10  
Old 05-31-2004, 11:48 AM
 
nerd luv nerd luv is offline
 

Advanced Member
  
Join Date: Jun 2003
Location: California, USA
Posts: 58
 

Default

OK, here's the entire code for include/register.php
It's all in 1 piece, but I divided it into 3 sections here to indicate the section that I changed. (1st piece of original code removed by request)

Here's the bit I changed:
Code:
# # Send mail to registered user (do not send to anonymous) # if ($config["General"]["modify_emails"]=="Y"){ if(!$anonymous_user) if ($usertype=="B") func_send_mail($email, "mail/signin_notification_subj.tpl", "mail/signin_partner_notif.tpl", $config["Company"]["users_department"], false); else func_send_mail($email, "mail/signin_notification_subj.tpl", "mail/signin_notification.tpl", $config["Company"]["users_department"], false); # # Send mail to customers department # if(!$anonymous_user) func_send_mail($config["Company"]["users_department"], "mail/signin_admin_notif_subj.tpl", "mail/signin_admin_notification.tpl", $email, true); }

This is original code at the end
Code:
# # Auto-log in # #if($anonymous_user && $usertype=="C") { if($usertype=="C" or ($usertype=="B" and $login=="")) { $auto_login = true; $login = $uname; $login_type = $usertype; $logged = ""; } } } else { # # Fields filled with errors # if ($fillerror) $reg_error="F"; if ($eerror) $reg_error="E"; if ($uerror) $reg_error="U"; } if($anonymous_user) { $uname=""; $passwd1=""; $passwd2=""; } # # Fill $userinfo array if error occured # $userinfo=$HTTP_POST_VARS; $userinfo["login"] = $uname; $userinfo["newsletter"] = ($newsletter=="on"?"Y":""); } else { # # REQUEST_METHOD = GET # if ($mode=="update") { $userinfo = func_userinfo($login,$login_type); } elseif ($mode=="delete" && $confirmed=="Y") { $olduser_info = func_userinfo($login,$login_type); $customer_language = func_get_language ($olduser_info); func_delete_profile($login,$login_type); $login=""; $login_type=""; $smarty->clear_assign("login"); # # Send mail notifications to customer department and signed customer # $mail_smarty->assign("userinfo",$olduser_info); # # Send mail to registered user # if (strstr($olduser_info["login"], $anonymous_username_prefix) ) $anonymous_user=true; else $anonymous_user=false; if(!$anonymous_user) func_send_mail($olduser_info["email"], "mail/profile_deleted_subj.tpl", "mail/profile_deleted.tpl", $config["Company"]["users_department"], false); # # Send mail to customers department # if(!$anonymous_user) func_send_mail($config["Company"]["users_department"], "mail/profile_admin_deleted_subj.tpl", "mail/profile_admin_deleted.tpl", $olduser_info["email"], true); } } #require "../include/countries.php"; #require "../include/states.php"; #$smarty->assign("current_category",$current_category); if ($uerror || $eerror || $fillerror || $error) { $userinfo[firstname]=stripslashes($firstname); $userinfo[lastname]=stripslashes($lastname); $userinfo[company]=stripslashes($company); $userinfo[ssn]=stripslashes($ssn); $userinfo[b_address]=stripslashes($b_address); $userinfo[b_city]=stripslashes($b_city); $userinfo[b_state]=stripslashes($b_state); $userinfo[b_zipcode]=stripslashes($b_zipcode); $userinfo[s_address]=stripslashes($s_address); $userinfo[s_city]=stripslashes($s_city); $userinfo[s_state]=stripslashes($s_state); $userinfo[s_zipcode]=stripslashes($s_zipcode); $userinfo[phone]=stripslashes($phone); $userinfo[fax]=stripslashes($fax); $userinfo[uname]=stripslashes($uname); $userinfo[login]=stripslashes($uname); $userinfo[passwd1]=stripslashes($passwd1); $userinfo[passwd2]=stripslashes($passwd2); $userinfo[password_hint]=stripslashes($password_hint); $userinfo[password_hint_answer]=stripslashes($password_hint_answer); } if ($userinfo) foreach ($userinfo as $key=>$value){ if (is_string($value)) $userinfo[$key]=htmlspecialchars($value); } $smarty->assign("userinfo",$userinfo); $smarty->assign("registered",$registered); $smarty->assign("reg_error",$reg_error); if($mode=="delete") { $smarty->assign("main","profile_delete"); } elseif($mode=="notdelete") { $smarty->assign("main","profile_notdelete"); } else $smarty->assign("main","register"); x_session_save(); ?>

Thoughts, anyone? Is there something else I need to modify?
__________________
Always happy to Paypal over some money for X-Cart solutions. I need to get this store running! Help!
--Testing 3.5.8, heavily modified, Linux, Apache 1.3.31, PHP 4.3.4--
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 04:27 PM.

   

 
X-Cart forums © 2001-2020