Jump to content

Mass change notifications settings


glorify

Recommended Posts

Set up notifications the way I wanted them as an admin to test on my test board, then I didn't change them and imported my community.

Nightmare. Members are really complaining about the email.

Any way to mass change notification settings? If not, I think it should be an option. Ideas?

Link to comment
Share on other sites

If we knew where it was located in the database I am sure you could run a query to change it from Yes to No, but I have looked through my test site's database and can't seem to find where it's located..

Maybe someone will come along that knows where this information is stored...

Jamie

Link to comment
Share on other sites


Any way to mass change notification settings? If not, I think it should be an option.



Unfortunately I don't have an answer for you.

However, stick this SQL Search query away to use sometime in the future:

SELECT t.name AS table_name,

c.name AS column_name

FROM sys.tables AS t

INNER JOIN sys.columns c ON t.OBJECT_ID= c.OBJECT_ID

WHERE c.name LIKE'%notif%'

ORDER BY table_name,column_name;

on line 5, change what's between the % % signs to what column you want to search your database for. This is a "like" search, so it will return all similar values. Go into your SQL Toolbox and enter this at the bottom in the Manual Query box. In this example, we're looking for any column named something like "notif" (as in notify or notification). The result:


table_name              column_name 

forums                  notify_modq_emails 

groups                  g_max_notifications 

inline_notifications    notify_from_id 

inline_notifications    notify_id 

inline_notifications    notify_read 

inline_notifications    notify_sent 

inline_notifications    notify_text 

inline_notifications    notify_title 

inline_notifications    notify_to_id 

inline_notifications    notify_type_key 

inline_notifications    notify_url 

links_tracker           track_notification 

members                 msg_show_notification 

members                 notification_cnt 

message_topic_user_map  map_ignore_notification 

profile_portal          pp_setting_notify_comments 

profile_portal          pp_setting_notify_friend



On the right are the different columns that match your "like" query, and on the left is the table where each one can be found. This has helped me find more than a few things in the database that I needed to change directly.

Note that all this does is query the database - it's read only. Anything above and beyond this is at your own risk.

I took a little stroll through the database for my forum and peeked in all of the obvious places...and the operative question remains: What table(s) are the notification settings stored in?

Link to comment
Share on other sites

I want same thing. My members are getting pissed off, for receiving 100's of status change notification email in one day.

Even though by selecting no email notification as default, they still get email notification. It is becoming spam fest.

Link to comment
Share on other sites

You cannot presently alter a member's notification options - they would have to do it themself in the user cp.

You cannot do it via a database query either - the way the data is stored is not "normalized" so that you can update it via a database query I'm afraid.

FWIW, they're stored in the member cache (ibf_members.members_cache).

Link to comment
Share on other sites

Brandon, then how do I stop the email spam fest? All I want is something by which my board doesn't send emails for recent status update and couple of other notifications, because users are not getting 2 or 3 emails per day, but they are getting more then 50 emails/day.

I can't tell all to change there options from UCP. Any way out before my email ID gets blacklisted ?

Link to comment
Share on other sites


Brandon, then how do I stop the email spam fest? All I want is something by which my board doesn't send emails for recent status update and couple of other notifications, because users are not getting 2 or 3 emails per day, but they are getting more then 50 emails/day.



I can't tell all to change there options from UCP. Any way out before my email ID gets blacklisted ?



Install the mod Log in as User, then you can sign in and change the settings.

If you want to do it for a bunch of people, it's a pain, but it's at least doable.

Please consider this a feature request folks.
Link to comment
Share on other sites


If you want to do it for a bunch of people, it's a pain, but it's at least doable.




Yeah, right like we have nothing to do in world and set settings for 3500 members on my forums? .....

There should be something easy available or doable to stop this spam fest. I hope they add option in 3.1.1 or at least provide one php script to mass change those settings.
Link to comment
Share on other sites

I have added the ability to configure a member's notification options when editing the member in the ACP for 3.1.1. I also took the opportunity to go ahead and add a few of their other configuration options that you couldn't previously modify in the ACP so you can now set them for the member when editing them in the ACP.

As for your current situation, I don't see any way to accomplish what you want at this time I'm afraid. Effectively, we would need to build a page where you can update ALL members on your site based on some static data. This could be useful in the future for various things (maybe update all members to use default language, or update all members to remove their signature), however at this time it's not possible to update all members' notification options. Additionally, due to how the data is stored (serialized and combined with other important data), it would be difficult to implement such a feature in the first place. We couldn't just issue an update query with a where clause - we would need a cycling script that updated something like 50 members per refresh, looping through all your members.

While it's something to consider, it won't be in 3.1.1 I don't believe.

Link to comment
Share on other sites

I understand your situation Brandon, but please consider our situation also. Due to the bug in 3.1.0, now I am following up with other email providers, as users started marking our email as spam because they got more then 50 emails in one day.

I can't change option for each user from admin CP. Will you do it for us? Let's be realistic here and it's clearly not possible for 3500 members. From my point of view, we need the fix for the damage which was caused by the bug. Since, you fixed the root cause future member option are good and they will not be spammed unknowingly.

If you could release/add something by which it can change the option for previous members altogether, it would be really great.

On a side note is there anyway I can remove friends from each user using query? So, if I remove friends from user at least board will stop sending them emails of recent status update.

I learned the lesson. Will never ever use first release. Thanks for following up.

Link to comment
Share on other sites

I shall throw ya people a cookie because when I read this topic I was quite horrified of the onslaught I would face not only from 80k members revolting, but a whole cluster of normally load balanced servers screaming in agony as they tried to send out the mail.

So I wrote this nifty script(based on some random tool code from ipb for ease) in about 20 minutes so mind it's slight messyness, it requires the php command line though it could be hardcoded and ran. But it has the nice navigation of options to set the different notification options types for each notification possiblity or whatever you want to call it.
So you pick say report center, you can type in "inline pm" and it will set that. then when you enter in go, all members get that setting. let's you set more than one kind of notification before running it.


#!/usr/local/bin/php

<?php


/**

 * It does stuff

 *

 */


define( 'IPS_IS_SHELL', TRUE );

define( 'IPB_THIS_SCRIPT', 'public' );


if ( file_exists( './initdata.php' ) )

{

	require_once( './initdata.php' );

}

else

{

	require_once( '../initdata.php' );

}


require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );

require_once( IPS_ROOT_PATH . 'sources/base/ipsController.php' );


$reg = ipsRegistry::instance();

$reg->init();


$moo = new moo( $reg );


class moo

{


	private $choiceArray = array( array('report_center','Report Center'), array('new_topic','New topic'), array('new_reply','New reply'), array('post_quoted','Post quoted'), 

		array('profile_comment','Profile Comments'), array('profile_comment_pending','Profile comments pending'), array('friend_request','Friend request'), 

		array('friend_request_pending','Friend request pending'), array('friend_request_approve','Friend request approve'), array('new_private_message','New private message'), 

		array('reply_private_message','Reply to private message'), array('invite_private_message','Private message invite'), array('reply_your_status','Reply to your status'),

		array('reply_any_status','Reply to any status'), array('friend_status_update','Friend status update') );


	private $notifications = array();

	private $processed = 0;

	private $start		 = 0;

	private $end			 = 0;


	function __construct( ipsRegistry $registry )

	{

		$this->registry		=	 $registry;

		$this->DB					=	 $this->registry->DB();

		$this->settings		=& $this->registry->fetchSettings();

		$this->request		=& $this->registry->fetchRequest();

		$this->cache			=	 $this->registry->cache();

		$this->caches			=& $this->registry->cache()->fetchCaches();

		$this->stdin			=	 fopen('php://stdin', 'r');



		$this->_print( "--------------------------------------------nWelcome to the IP.Board Member Name Mass Notification Setting Changern--------------------------------------------n" );

		$this->_print( "Start at ID (Enter 0 to start from the very first entry)nEnter: " );


		$this->start = intval( $this->_fetchOption() );


		$this->_print( "Process X rows (Enter 0 to process all rows)nEnter: " );


		$this->end = intval( $this->_fetchOption() );



		$picking	= true;

		while( $picking )

		{

			$this->_print( "nSettings to change, enter the number of the item you wish to change." );

			$this->_printChoices();

			$this->_print( "OR enter GO to continue OR enter QUIT to quit the script" );


			$choice = $this->_fetchOption();

			if( strtolower($choice) == 'go' )

			{

				$picking = false;

				continue;

			}

			elseif( strtolower($choice) == 'quit' )

			{

				exit();

			}

			else

			{

				$this->_print( "nPlease enter any combination of the following options separated by spaces:" );

				$this->_print( "inline" );

				$this->_print( "pm" );

				$this->_print( "email" );

				$this->_print( "Ex. You can enter just inline or you can enter in inline pm" );

				$this->_print( "If you wish to cancel this, type in cancel, otherwise a blank entry will count!" );


				$setting = trim($this->_fetchOption());

				if( $setting == 'cancel' )

				{

					continue;

				}

				if( !empty($setting) )

				{

					$setting = explode(' ', $setting);

					foreach($setting as $opt)

					{

						$this->notifications[ $this->choiceArray[$choice-1][0] ]['selected'][] = $opt;

					}

					continue;

				}

				else

				{

					$this->notifications[ $this->choiceArray[$choice-1][0] ]['selected'] = array();

				}

			}

		}


		while( ( $result = $this->_process() ) !== FALSE )

		{

			$this->_print( $result );

		}		


		/* We're done.. */

		$this->_print( "COMPLETE" );

	}


	private function _printChoices()

	{

			for($i=1; $i <= count($this->choiceArray); $i++)

			{

				$this->_print( "{$i}. {$this->choiceArray[$i-1][1]}" );

			}

	}


	/**

	 * Rebuild langs

	 */

	private function _process()

	{		

		if ( ! $this->end OR ( $this->end > $this->processed ) )

		{

				$batch					 = 50;

				$_s						 = $this->processed + $this->start;

				$_e						 = ( $this->end AND $this->end < $batch ) ? $this->end : $batch;

				$this->processed = $_s + $batch;

				$this->start	 = 0;

				$converted			 = 0;

				$seen						 = 0;


				$this->DB->build( array( 'select' => '*',

										 'from'		=> 'members',

										 'order'	=> 'member_id ASC',

										 'limit'	=> array( $_s, $_e ) ) );


				$t = $this->DB->execute();


				while( $row = $this->DB->fetch( $t ) )

				{

					$cache = unserialize( $row['members_cache'] );

					if( is_array( $cache['notifications'] ) )

					{

						$cache['notifications'] = array_merge($cache['notifications'], $this->notifications);

					}

					else

					{

						$cache['notifications'] = $this->notifications;

					}

					$cache = serialize( $cache );


					$this->DB->update( 'members', array( 'members_cache' => $cache ), 'member_id=' . $row['member_id'] );


					$done++;


					/* Clear cached queries */

					$this->DB->obj['cached_queries'] = array();

				}

		 }


		if ( $done )

		{

			/* Check for more.. */

			return "Completed... " . $done . " (Last ID=" . $row['member_id'] . " total=" . ( $this->start + $done ) . ")";

		}

		else

		{

			return FALSE;

		}			

	}



	/**

	 * Out to stdout

	 */

	private function _print( $message, $newline="n" )

	{

		$stdout = fopen('php://stdout', 'w');

		fwrite( $stdout, $message . $newline );

		fclose( $stdout );

	}


	/* Fetch option

	 *

	 */

	private function _fetchOption()

	{

		return trim( fgets( $this->stdin ) );

	}

}


exit();									




?>






I take no responsbility for it messing up your notification settings if you run it. I haven't had the chance to test it fully(but it works locally for me) because I delayed IPB 3.1 deployment due to 3.1.1 coming out in a week so theres no point in reapplying all the customizations and big board optimizations so soon.


Also I work for clients so I can't post this in that "I'm special" club forum you guys got on these forums :P

Link to comment
Share on other sites


I shall throw ya people a cookie because when I read this topic I was quite horrified of the onslaught I would face not only from 80k members revolting, but a whole cluster of normally load balanced servers screaming in agony as they tried to send out the mail.




More then 20 members on our forums asked to delete there accounts and our email and IP got blacklisted by many other companies. 3.1.0 version created huge spam fest on our forums.

Since, I am not that technically sound can you please tell me on how to use that php script? I will take my chances and use your method since IPB support team has given up on these issue.

I really don't understand one thing. If you can write script in 20 min, then Brandon, Matt, etc are all super geeks/coders. It's sad that they are not helping us :(
Link to comment
Share on other sites


This is not a bug.



It's not a "spam fest" that your site was configured to send email notifications and it sent email notifications.




No, it was a bug.

http://community.invisionpower.com/tracker/issue-23205-default-notifications-configuration/

Even though I didn't selected Email notification as default, it still kept Email notification by default on.

My site was not at all configured to send email notification.
Link to comment
Share on other sites


More then 20 members on our forums asked to delete there accounts and our email and IP got blacklisted by many other companies. 3.1.0 version created huge spam fest on our forums.



Since, I am not that technically sound can you please tell me on how to use that php script? I will take my chances and use your method since IPB support team has given up on these issue.



I really don't understand one thing. If you can write script in 20 min, then Brandon, Matt, etc are all super geeks/coders. It's sad that they are not helping us :(




I'd be curious to know who exactly black listed you for this :P


And really it's not that hard to throw the instructions in the email templates on how to turn it off
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...