![]() |
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 :) |
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); to: Code:
if ($config["General"]["modify_emails"]=="Y"){ howzat? |
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. :) |
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 :( |
If you ran the insert statement on your dbase, the checkbox should automatically appear.
|
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 ???? |
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 198) Original Code:
# New Code:
# 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 ! :D |
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! |
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)! |
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:
# This is original code at the end Code:
# Thoughts, anyone? Is there something else I need to modify? |
Please don't post all of the code. I am getting a headache trying to look at it. Just post the relevant stuff. Because you posted all of that the page displays so wide that it is crazy. Please go back and delete all of the extra cr@p.
You are modding the wrong code. You have modded a different area of the file. Go back and look at the code in the examples above. Around line 158-160 ish. That's where the change needs to happen. There are a lot of lines that are similar, so you need to read what you are changing. Look for this line in your file and then you will have the correct area. # # Send mail to registered user # $customer_language = func_get_language ($newuser_info["language"]); |
Originally I cut and pasted the examples at the top, which is how I eliminate the possibility of me messing up the new code. I searched for the "original code" posted by BoomBoomBap in register.php , and there was only 1 instance, so that is what I replaced with his new code.
The portion of original code that starts with Code:
$customer_language = func_get_language ($newuser_info["language"]); Code:
# which seems to have done the trick. Modified a profile and neither the client nor the administrator received an e-mail. Whew. |
:oops: Me again!
I am just setting up 3.5.8 and today I noticed that when a customer profile is modified, I don't see the confirmation message. $txt_profile_modified is defined (still at the default "Your profile has been modified."), and skin1/customer/main/register.tpl still calls is with Code:
{if $smarty.post.mode eq "update" or $smarty.get.mode eq "update"} Register.php and register.tpl are the only files that would control this, right? The only editing I have done to either is the change above. Has anyone else noticed this? |
Do you have the emails enabled or disabled?
|
They are disabled. It would just be too much e-mail to recieve them, but I'm sure you relate as we're both using this mod!
EDIT: I tried deselecting this option, but the confirmation message still does not appear on the page. Additionally, the confirmation e-mails are blank except for the title. Also, note that I am now trying this in version 3.5.8. I originally got it working fine in 3.4.14, but 3.5.8 is where I'm finding all these issues. |
Quote:
Can anyone direct me to where I can read up on how to insert stuff into a MySql database? I do not see a command line in my program to do this... Mike |
What version are you using please? It should be in your forum signature.
|
Sorry Adpboss, I have added the information into my signature as you have requested.
|
Cool. That makes it easier to answer your questions because each point release 3.X is different than the last.
In the admin you can go to patch/upgrade and enter it into the Apply SQL Patch, Queries box. Please do a FULL backup of your database before attempting this. If the database patches then you are laughing. This is an easy and excellent mod. They included similar email mods in the 4.0 beta. There is no reason why it shouldn't patch but if you have a problem, just post back here again! :D |
I am feeling real stupid here.... with my old cart I was a wiz and was helping everyone out in the forums and here I cant even keep my head above water.
I tried going into Patch/Upgrade and tried to make this happen and it told me it succesfully did it and I do not see this anywhere in the general setting area. Help Please... |
I'll help you in a bit. Go relax and have a beer or something.
We'll get through this. |
OK, with version 3.5.x the patch needs to be changed.
Backup backup backup because I am not responsible if you run into a problem, ok? Run this SQL Query to remove the previous sql query you applied. Quote:
Then apply this patch. Code:
INSERT INTO `xcart_config` VALUES ('modify_emails', 'Enable email notifications for User Account Modifications', 'Y', 'Email', 100, 'checkbox', 'N'); You can find the checkbox and item in your General Settings, under the email subcategory. Good luck. |
Ok that is working I now see the message with the checkbox.... Thank you Adpboss for sending me to this thread in the first place and sticking it out withme to make sure it came through... I really appreciate it....
Now I do not want to get off topic but you say backup backup backup... I went into backup and clicked the box that said "Write SQL dump to file......" and then saved that file on my harddrive.... Now it is telling me that the dump file is 11megs... I am assuming because it has all my pictures in there BUT it only lets you restore a backup of 2 megs or less... so how does one accomplish restoring a backup? |
This is totally off topic so I'll make it short and sweet. After that you'll have to start your own thread.
What server software are you using? Is PHPMyAdmin installed? I prefer to backup from CPanel and have been lucky that I have not had to make any full restores to date. You could also use PHPMyAdmin. Personally I never backup from within X-Cart. Take your images out of the database. Your backups will be faster and easier to restore. Use the filesystem to store your images. You can search the forums for info on "Image Location". Best of luck. The info is all here, you just might have to spend an evening searching it out. |
Thank you... I will spend some time searching... and I agree didnt want to take it to far off topic thank you
|
Updated Mod for 3.5.9
The include/register.php needs to be different if you are using my SQL Query (posted above and in this post). This change happens around line 190 of include/register.php for version 3.5.9. Code:
# Note that the if statement is now Code:
if ($config["Email"]["modify_emails"]=="Y") You also need to run this Insert query on your database. It can be done from the Patch/Upgrade area of the admin (SQL QUERY). Code:
INSERT INTO `xcart_config` VALUES ('modify_emails', 'Enable email notifications for User Account Modifications', 'Y', 'Email', 100, 'checkbox', 'N'); That will place the checkbox in the General Settings/Email Options. Thanks to FunkyDunk for the original help. This mod will be redundant in version 4.0 I believe but is very handy for version 3.5, 3.4 and 3.3 Happy X-Carting! |
I just applied the patch (the above post) and it worked straight off on my 3.5.10 installation - great mod guys!
Thanks to all who contributed, Philip. |
All times are GMT -8. The time now is 09:34 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.