1
关注
1547
浏览

4.0版本如何配置新注册用户 默认全部不勾选邮件通知

AI智能回复搜索中,请稍后...

为什么被折叠? 0 个回复被折叠
林威 注册会员 用户来自于: 广西南宁市
2022-06-09 02:23

看了一下表结构,有两个解决思路。


1、整体配置法

即在 用户管理-通知配置 里面,编辑具体的通知。

比如,

回答被设为最佳BEST_ANSWER
原始设定是: site,email

即点击 编辑,通知类型:中,站内通知 和邮件通知 是勾选的。

把邮件通知取消勾选,设定就会变成  site。

如果想批量把全部都改成站内通知,一个个点太麻烦了。

直接SQL吧:

UPDATE aws_users_notify_setting
SET type = 'site'
WHERE type = 'site,email'

执行结果:

UPDATE aws_users_notify_setting
SET type = 'site'
WHERE type = 'site,email'
> Affected rows: 29
> 时间: 0.055s


但这么操作的缺点是:用户界面就不会有任何勾选的可能性了,连勾选框都没了。


当然了,如果本来就不想让用户勾选,这么干当然666。


2、单独配置法

我们不折腾全局的配置表了。看看用户配置写在哪里。

用户的默认通知设置信息,在aws_users_extends表中。

只需要给每一个用户都写入相同的设置项,就可以实现有勾选框,但是默认不勾选,的效果。

怎么写入呢?

当然是找一个用户的数据样板,然后把这个样板克隆到所有和克隆体不同的用户身上。

UPDATE aws_users_extends
SET notify_setting = '{"site":["BEST_ANSWER","TYPE_PEOPLE_FOCUS_ME","QUESTION_ANSWER","QUESTION_COMMENT_AT_ME","QUESTION_ANSWER_COMMENT_AT_ME","NEW_ANSWER_COMMENT","INVITE_ANSWER","NEW_ARTICLE_COMMENT","ARTICLE_COMMENT_AT_ME","NEW_QUESTION_COMMENT","AGREE_CONTENT","TYPE_QUESTION_APPROVAL","TYPE_ARTICLE_APPROVAL","TYPE_QUESTION_DECLINE","TYPE_ARTICLE_DECLINE","TYPE_QUESTION_MODIFY_APPROVAL","TYPE_ARTICLE_MODIFY_APPROVAL","TYPE_ANSWER_APPROVAL","TYPE_ANSWER_MODIFY_APPROVAL","TYPE_QUESTION_MODIFY_DECLINE","TYPE_ARTICLE_MODIFY_DECLINE","TYPE_ANSWER_DECLINE","TYPE_ANSWER_MODIFY_DECLINE","TYPE_COLUMN_APPROVAL","TYPE_COLUMN_DECLINE"]}'
WHERE
notify_setting !='{"site":["BEST_ANSWER","TYPE_PEOPLE_FOCUS_ME","QUESTION_ANSWER","QUESTION_COMMENT_AT_ME","QUESTION_ANSWER_COMMENT_AT_ME","NEW_ANSWER_COMMENT","INVITE_ANSWER","NEW_ARTICLE_COMMENT","ARTICLE_COMMENT_AT_ME","NEW_QUESTION_COMMENT","AGREE_CONTENT","TYPE_QUESTION_APPROVAL","TYPE_ARTICLE_APPROVAL","TYPE_QUESTION_DECLINE","TYPE_ARTICLE_DECLINE","TYPE_QUESTION_MODIFY_APPROVAL","TYPE_ARTICLE_MODIFY_APPROVAL","TYPE_ANSWER_APPROVAL","TYPE_ANSWER_MODIFY_APPROVAL","TYPE_QUESTION_MODIFY_DECLINE","TYPE_ARTICLE_MODIFY_DECLINE","TYPE_ANSWER_DECLINE","TYPE_ANSWER_MODIFY_DECLINE","TYPE_COLUMN_APPROVAL","TYPE_COLUMN_DECLINE"]}'

然后,效果是:


是不是强迫症被治愈了呢?


当然,最好是官方能够给一个界面,让管理员可以设定新用户在aws_users_extends表中notify_setting字段的的默认值。

关于作者

林威 注册会员

这家伙很懒,就是不设置简介

问题动态

发布时间
2022-06-09 01:24
更新时间
2022-06-09 02:23
关注人数
1 人关注

相关问题