The discussion revolves around generating a report of users who have unsubscribed from the Discourse digest. SouperC seeks a way to identify these users to sync with external systems like ActiveCampaign. sam provides a Rails console command to retrieve emails of users with email_digests set to false. hutchinsfairy suggests using the Data Explorer plugin with a SQL query to fetch detailed user data, including unsubscribe status. SouperC acknowledges the solution and plans to install the Data Explorer plugin.
Is there a way I can run a report on which users have unsubscribed from the Discourse digest for my site?
I’d like to flag them elsewhere (ActiveCampaign) too so that they don’t have to unsubscribe in to places. Or get pi$$ed at us because they thought they were opting out of everything.
If you’re doing this often then you could install the Data Explorer plugin and use query:
SELECT u.ID "User ID"
,u.USERNAME "Username"
,u.NAME "Name"
,CASE uo.EXTERNAL_LINKS_IN_NEW_TAB
WHEN 't' THEN 'True'
WHEN 'f' THEN 'False'
ELSE 'Not set'
END "External links?"
,CASE uo.mailing_list_mode
WHEN 't' THEN 'True'
WHEN 'f' THEN 'False'
ELSE 'Not set'
END "Mailing List Mode?"
,CASE uo.email_digests
WHEN 't' THEN 'True'
WHEN 'f' THEN 'False'
ELSE 'Not set'
END "Email Digests?"
,digest_after_minutes/60 || ' Hours' "Digest Every"
FROM USERS u
LEFT OUTER JOIN USER_OPTIONS uo
ON u.ID = uo.USER_ID
WHERE uo.email_digests = 'f'
AND u.ID <> -1