We send a triggered email via Discourse to all users when a new topic is posted by an admin in a specific section. I assume some users are unsubscribing from these triggered emails and/or changing their email preferences upon receiving the email.
Is there a way to track the number of unsubscribes?
We were able to use the data explorer plugin to find the users who are no longer watching the category (thanks @pfaffman!). We would also like to find the users who unsubscribe by clicking on “To unsubscribe from these emails, click here” and then selecting “Don’t send me any mail from Squarespace Circle Forum”
Do you have any insight on the best way to query the results for the don’t send me any mail folks?
-- ネガティブなメール設定を持つユーザーをリストし、TL、タッチ日、およびCheersを含める
SELECT u.ID "ユーザーID"
,u.USERNAME "ユーザー名"
,u.trust_level "TL"
-- 次の行は、Gamificationプラグインからの全期間のCheersスコアをオプションで含みます。下の2番目の結合を参照してください。
,di.gamification_score "Cheers"
,CAST (u.first_seen_at AS DATE) "参加日"
,CAST (u.last_seen_at AS DATE) "最終アクセス日"
,CAST (u.last_emailed_at AS DATE) "最終メール送信日"
,CASE uo.email_digests
WHEN 't' THEN 'はい'
WHEN 'f' THEN 'いいえ'
ELSE '未設定'
END "ダイジェスト受信?"
,CASE uo.email_level
WHEN 0 THEN '受信しない'
WHEN 1 THEN '不在時'
WHEN 2 THEN '常に受信'
END "メールレベル"
,CASE uo.email_messages_level
WHEN 0 THEN '受信しない'
WHEN 1 THEN '不在時'
WHEN 2 THEN '常に受信'
END "メールメッセージレベル"
FROM USERS u
LEFT OUTER JOIN USER_OPTIONS uo
ON u.ID = uo.USER_ID
-- この2番目の結合は、Gamificationプラグインからの全期間のCheersスコアを含みます
LEFT OUTER JOIN directory_items di
ON u.ID = di.USER_ID AND di.period_type = 1
-- 次のSELECTステートメントを使用して、トピックアクティビティメールを受信していないユーザーをリストします
WHERE uo.email_digests = 'f' OR (uo.email_level = 0)
-- または、次のSELECTステートメントを使用して、トピックアクティビティメールもメッセージアクティビティメールも受信していないユーザーをリストします
-- WHERE uo.email_digests = 'f' OR (uo.email_level = 0 AND uo.email_messages_level = 0)
AND u.ID <> -1
ORDER BY u.last_emailed_at DESC