如何为新用户订阅通知?

How to subscribe new user to notifications?

我已经安装了SonarQube 5.2,我想默认启用新用户通知。我的意思是these checkboxes in user profile。 如果有人有类似问题,我无法在文档、可用插件、Internet 中找到答案。到目前为止我发现的是 SQ 数据库中的用户属性:

sonar=# select * from properties where user_id=6;
 id |                          prop_key                           | resource_id | text_value | user_id 
----+-------------------------------------------------------------+-------------+------------+---------
 85 | favourite                                                   |        3260 |            |       6
 91 | notification.ChangesOnMyIssue.EmailNotificationChannel      |             | true       |       6
 92 | notification.NewFalsePositiveIssue.EmailNotificationChannel |             | true       |       6
 93 | notification.SQ-MyNewIssues.EmailNotificationChannel        |             | true       |       6
 94 | notification.NewIssues.EmailNotificationChannel             |             | true       |       6
 95 | notification.NewAlerts.EmailNotificationChannel             |             | true       |       6
(6 rows)

我什至搜索过源代码,但没有找到如何在用户注册时设置用户属性。实现该目标的最佳方法是什么?

The documentation 已更新为特定于此情况:未提供任何功能来为其他用户订阅通知。每个用户必须自己选择接收通知。

虽然我理解希望人们为自己选择垃圾邮件,但我们公司需要要求开发人员立即修复他们的安全问题。因此,我们要求开发人员收到通知,以便他们了解问题。它们实在是太多了,无法持续 "use the act of persuasion".

这是我用来为所有尚未打开通知的开发人员打开 "My New Issues" 通知的插入语句:

INSERT INTO properties 
        (prop_key, 
         resource_id, 
         user_id, 
         is_empty, 
         text_value, 
         clob_value, 
         created_at)
SELECT 'notification.SQ-MyNewIssues.EmailNotificationChannel', 
       NULL, 
       u.id, 
       0, 
       'true', 
       NULL, 
       Unix_timestamp(Now()) 
FROM   users u 
       LEFT JOIN properties p 
              ON ( u.id = p.user_id 
                   AND 
       p.prop_key = 'notification.SQ-MyNewIssues.EmailNotificationChannel' ) 
WHERE  p.user_id IS NULL;