Active
Project:
Messaging
Version:
6.x-2.2
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
13 Jul 2009 at 18:42 UTC
Updated:
5 Apr 2012 at 21:14 UTC
Great module.
My site has about 150 users. I've just added the MIME Mail module. I'd like to send all future email notifications as an HTML email. How do I change the settings for all my existing users so they are all configured to use MIME mail? I don't really want to manually go through the edit page of all 150 users! I have looked in the MySQL database and the vital setting seems to be buried deep in the "data" field of the user table and my SQL skills aren't up to the task of swapping out just one character in that field.
Any thoughts?
Many thanks,
Jack
Comments
Comment #1
dan_aka_jack commentedComment #2
igorik commentedGood question, interesting for me too.
I have abut 8000 users on my site and I would like to change for everybody time interval.
Thanks
Igor
http://www.somvprahe.sk
Comment #3
lelizondo commentedThe same here. I like to change the time interval and the send method in +/- 1000 users. I think that the send method is controlled by messaging and the time interval is controlled by notifications (could be wrong).
I'm thinking that the only way to do this would be to uninstall notifications and reinstall, but I'm not 100% sure this will work since the info is in the 'users' table.
I also thought about creating some option with views_bulk_operations but right know is only an idea, I would need to start reading both modules to see if that's even possible.
Anyone has a better idea.
Comment #4
jshuster@drupal.org commentedIt looks like you can do this in php. Take a look at the function messaging_user_setting() in messaging.module; it looks like user settings are stored on the user object.
If you know php, you could configure one user account manually, then inspect the user object to see what account variables are set. Then write a simple function to loop through all users and set the account variable accordingly. You'd use the user_load() and user_save() functions -- see api.drupal.org for how these work. Of course, do this on a copy of your site first, and test test test.
Comment #5
plan9 commentedI changed all of my users default send method to mime mail by running the following MySql query in phpMyAdmin:
UPDATE `notifications` SET `send_method` = 'mail';
To change the time interval you could run:
UPDATE `notifications` SET `send_interval` = '86400'; (or whatever time value).
Seems to do the trick, but (as always) backup your database before tampering with it and don't blame me if your site goes kaput afterwards.
Comment #6
jose reyero commentedSolution in #5 looks good.
Comment #8
Alan.Guggenheim commentedHow about changing the time interval for users that are members of a specific Group?
Can that be done with VBO?
Comment #9
finex commentedsolution on #5 doesn't solve the initial problem: it simply change the default settings of the module but it doesn't change users settings.