Disable email notifications for NEW TOPICS in workgroups and districts
Description
A user gets an e-mail notification every time a new topic in a district or workgroup they are in is opened. There have been mails to the info@ from time to time to wish to be able to disable these e-mail notifications.
Impact
Foodsavers
Proposal
Under Profile settings in notifications there should be a list of districts/workgroups the person is in and make it possible to disable e-mail notifications.
option 1) expand table fs_foodsaver_has_bezirk
with field new_topic_mail
of either typetinyint
or byte
option 2) create new table fs_region_follower
with bezirk_id
, foodsaver_id
-
option 2 is more like the other fairteiler_follower and forum_post follower are handled. but it would mean a bit more work since the table doesn't exist and it would need to be implemented if someone joins / leaves a district / workgroup.
descripton following option 1)
default setting would be 1
for new_topic_mail
: user receives emails for new topics
so when a user joins a district existing code probably wouldn't need to be touched as it is set to 1 by default.
have in the personal settings page a new part for districts according to the other settings for threads and fair-share-points.
"Willst du Emails für neue themen in "bezirkname"/"AG-Name" erhalten ja (1) oder nein (0)"
in the sendmail routine for new topics it has to get "users from this district having new_topic_mail = 1"
Links / references
https://gitlab.com/foodsharing-dev/foodsharing/blob/master/src/Services/ForumService.php#L172
function notifyUsersNewThread
https://gitlab.com/foodsharing-dev/foodsharing/blob/master/src/Services/ForumService.php#L182
function listActiveWithFullNameByRegion
would need to be either changed or a new function listActiveWithNewPostAllowFullNameByRegoin
implemented
There is an active flag - what does it mean ? https://gitlab.com/foodsharing-dev/foodsharing/blob/master/src/Modules/Foodsaver/FoodsaverGateway.php#L513
For the Ambassador forums i would say that they can't be unsubscribed - if that annoys someone then they shouldn't be bot.
To get the list for settings :
https://gitlab.com/foodsharing-dev/foodsharing/blob/master/src/Modules/Settings/SettingsView.php#L152
function settingsInfo
needs to be extended for regions
and a code block similar to threads
added probably with string region_
.
Who calls settingsInfo
and where are the variables set ?
https://gitlab.com/foodsharing-dev/foodsharing/blob/master/src/Modules/Settings/SettingsControl.php#L423
here some information with substr region_
could be added
new function updateNewPostInRegion
needs to be added that sets new field new_topic_mail
according value