'Reply by email' badge

Anyone done a reply by email badge?

1 Like

I’m not too sure, but it shouldn’t be too hard considering the Post table has via_email boolean. Find Posts where via_email is true and get the user_id of that post!

1 Like

Here is a Reply by Email Badge:

select
    p.user_id
    ,min(p.created_at) granted_at
    ,min(p.id) post_id
from badge_posts p
where
    (:backfill or p.id IN (:post_ids) ) 
    and p.post_number >1
    and p.via_email=True
group by 
    p.user_id

7 Likes

That is a great idea for a badge, we should add it for our next release (adding it to the list)

7 Likes

Could also do a topic created via email badge (but I haven’t activated that functionality).
Probably something like:

select
    p.user_id
    ,min(p.created_at) granted_at
    ,min(p.id) post_id
from badge_posts p
where
    (:backfill or p.id IN (:post_ids) ) 
    and p.post_number =1
    and p.via_email=True
group by 
    p.user_id
1 Like