-
Notifications
You must be signed in to change notification settings - Fork 26
Documentation for Developers
Tamaro Walter edited this page Jul 9, 2025
·
12 revisions
This Documentation explains classes, functions and features that need a longer explanation than an inline comment can give.
The mail_manager function moodleoverflow_get_unmailed_posts has a long sql query with a complex structure.
Let's break it down, beginning from the center.
-
SELECT * FROM (...) as subscriptions: This part retrieves the user id that are subscribed to a moodleoverflow. There are different ways to be subscribed to a moodleoverflow (forced subscriptions to the whole forum, optional subscriptions to only certain forums or even discussions) and moodleoverflows stores them differently in the databases (forced subscriptions that cannot be undone are stored as a parameter inmoodleoverflowtable, for optional subscriptions there are two database tables that store the user and the moodleoverflow or the exact discussion). The first part only retrieves the data of the two moodleoverflow subscription tables. For the forced subscriptions a search is needed, where all enrolled users of
TL;DR: The Query tables returns a list of all unmailed posts together with the information about the author of the post and the user that will receive an email. One row per mail (1 unmailed posts and 5 receivers: 5 rows).