Set default options to "watch this thread" and receive email notifications?

cmeinck

Well-known member
Is it possible to pre-set users option defaults to "watch this thread" and "receive email notifications" checked?
 
I don't see any system for managing user prefs yet. But you can run this query to set those two checkboxes for all current users:

Code:
UPDATE xf_user_option
SET default_watch_state = 'watch_email'

I tested it and it appears to work. Backup first.

Use
Code:
UPDATE xf_user_option
SET default_watch_state = 'watch_no_email'
to disable the email notification.

Any guess on how we can set this as default on newly registered members to (editing the mysql default don't work)?
 
Also, this should work for new users:
Code:
	/**
	 * Form to add a user.
	 *
	 * @return XenForo_ControllerResponse_Abstract
	 */
	public function actionAdd()
	{
		$user = array(
			'user_id' => 0,
			'timezone' => XenForo_Application::get('options')->guestTimeZone,
			'user_group_id' => XenForo_Model_User::$defaultRegisteredGroupId,
			'style_id' => 0,
			'language_id' => XenForo_Application::get('options')->defaultLanguageId,
			'user_state' => 'valid',
			'content_show_signature' => 1,
			'show_dob_year' => 1,
			'show_dob_date' => 1,
			'receive_admin_email' => 1,
			'visible' => 1,
			'allow_view_profile' => 'everyone',
			'allow_post_profile' => 'everyone',
			'allow_send_personal_conversation' => 'everyone',
			'allow_view_identities' => 'everyone',
			'allow_receive_news_feed' => 'everyone',
			'default_watch_state'=> 'watch_no_email'
		);
 
That don't work. I've edited frontController_register.php and addded a query do edit it "manually". That edit works, but only when you add users in the admincp. Or at least i suppose so.
 
it appears there is no straight-forward way to do it then.
looking at this template code i wonder what the function of 'value=1' is
PHP:
<label><input type="checkbox" name="default_watch_state" value="1" class="Disabler"
{xen:checked $visitor.default_watch_state} /> {xen:phrase  automatically_watch_threads_you_create_or_when_you_reply}...</label>
 
Hey guys, any updates? Is there a method to enable email notifications by default? (seems pretty important, IMO. Expected behavior the same as other forums).
 
Is there a method to enable email notifications by default?
It's done in the ACP for new members - Options -> User Registration: Watch threads when creating or replying

For existing members you will need to run the query Jake posted.
Code:
UPDATE xf_user_option
SET default_watch_state = 'watch_email'
 
Top Bottom