Imagine a member has selected groups and sub-categories he is interested in.
I want to send an announcement to those who selected either of those groups and sub-categories.
Example: In a city made of the global main city, several boroughs and matters.
I would also have groups that are borough-matter specific.
The user can select:
A specific matter (Which as a general group),
A group in his borough for this matter,
A group in two other borough for this matter,
A second specific matter (Which as a general group),
All groups in all boroughs for this matter,
The main group for the main city;
If I wish to send an email to one or more groups or subcategories in these groups, some users might end up receiving more than one email of the same announcement, especially if the person selected the main city group that would forward the info from all boroughs and matters, plus some subgroups, etc.
The question: How can I prepare a mailing touching more than one targeted group and sub-categories list, duplicate-free, and send that message?
Thanks, Do you know if we can automate that, such as requesting the API to receive messages for each new member registration/withdraw or group/category selection, and receive only the new changes OR (less good) the whole list with their group/category, that can be requested by a Python program?
(I can manage to code Python). The question is more about automating communication between Discourse and Python AND Python and Mailing processor.
Discourse provides a robust REST API that allows you to:
List all users, groups, and user-group memberships
Monitor new user registrations and group join/leave actions (via polling or webhooks)
Retrieve category membership configurations
You can query either the full list or attempt to track recent changes. For full incremental change detection, you may need to implement time-based checks and manage differences locally. Authentication is handled through HTTP headers (Api-Key, Api-Username).
However, for more efficient and integrated control, I recommend creating a custom Discourse plugin. A plugin runs inside the Discourse server environment and provides direct access to Discourse internals, such as:
User, group, and category membership updates
Lifecycle event hooks for registrations and group changes
Direct access to Discourse’s internal APIs and database
This approach gives you real-time capabilities and greater flexibility for implementing automated workflows like mail handling or user segmentation.
@EMHmark7 did you end up figuring out how you want to get this working?
In Discourse, one way to get at what you want is to create categories and to let members in the community “subscribe” to those categories by choosing the “watching” notification level. The Default categories watching or Default categories watching first post are handy for having an announcements category on your site, to reach out to everyone on your site.
I believe there are ways to manage the above based on group membership or some other criteria but I haven’t done it myself in a while - maybe somebody else has a recipe they can share.
Another approach is to PM the groups directly - if you send a PM to a handful of groups and the same member is in multiple groups there will not be any duplication.
But it does sound to me like you might be looking for a different tool, if what you want is not a forum or community that people log into to participate in discussions but rather a bunch of mailing lists that sends out email.