Advertisement:

Author Topic: How to export the email addresses from a particular membergroup?  (Read 996 times)

Offline aksal

  • Semi-Newbie
  • *
  • Posts: 48
    • Zerion.net on Facebook
    • @zerionnet on Twitter
    • Zeriyt - Forumi Shqiptar - Zerion
What query do I want to run to export the email addresses from a particular membergroup?
I use SMF 2.0.15
Thank you.

Offline Oldiesmann

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,866
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • https://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: How to export the email addresses from a particular membergroup?
« Reply #1 on: May 13, 2019, 05:57:35 PM »
There is no built-in functionality to do this in SMF.
Michael Eshom
Cincy Space - now open!

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 21,389
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: How to export the email addresses from a particular membergroup?
« Reply #2 on: May 13, 2019, 05:59:12 PM »
You would need to run an sql query via phpmyadmin or another tool from the smf_members table where id_group = group id you need
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 50,969
Re: How to export the email addresses from a particular membergroup?
« Reply #3 on: May 13, 2019, 06:30:12 PM »
what is the reason you want to export their email addresses? if it is to send an email to them you can do that using the newsletter function.

Offline aksal

  • Semi-Newbie
  • *
  • Posts: 48
    • Zerion.net on Facebook
    • @zerionnet on Twitter
    • Zeriyt - Forumi Shqiptar - Zerion
Re: How to export the email addresses from a particular membergroup?
« Reply #4 on: May 13, 2019, 09:50:20 PM »
what is the reason you want to export their email addresses? if it is to send an email to them you can do that using the newsletter function.

It takes like forever if I use the build in Newsletter function because I have a lot of users. That's why I need to export the addresses and use an external tool for sending emails.

Offline aksal

  • Semi-Newbie
  • *
  • Posts: 48
    • Zerion.net on Facebook
    • @zerionnet on Twitter
    • Zeriyt - Forumi Shqiptar - Zerion
Re: How to export the email addresses from a particular membergroup?
« Reply #5 on: May 13, 2019, 09:51:08 PM »
You would need to run an sql query via phpmyadmin or another tool from the smf_members table where id_group = group id you need

What would be the right query for this?
Thanks

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 21,389
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: How to export the email addresses from a particular membergroup?
« Reply #6 on: May 13, 2019, 10:33:39 PM »
select email_address from smf_members where id_group = ###
### replace with group id
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline Oldiesmann

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,866
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • https://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: How to export the email addresses from a particular membergroup?
« Reply #7 on: May 13, 2019, 10:45:51 PM »
Might want to change that last part to "id_group = ### OR FIND_IN_SET(###, additional_groups)" to catch any members who are in that group but don't have it as their primary group.
Michael Eshom
Cincy Space - now open!

Offline aksal

  • Semi-Newbie
  • *
  • Posts: 48
    • Zerion.net on Facebook
    • @zerionnet on Twitter
    • Zeriyt - Forumi Shqiptar - Zerion
Re: How to export the email addresses from a particular membergroup?
« Reply #8 on: May 27, 2019, 06:02:10 PM »
select email_address from smf_members where id_group = ###
### replace with group id
Code: [Select]
MySQL returned an empty result set (i.e. zero rows). (Query took 0.0005 seconds.)

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 21,389
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: How to export the email addresses from a particular membergroup?
« Reply #9 on: May 27, 2019, 06:12:16 PM »
Do what  Oldiesmann suggested above them in addition
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline aksal

  • Semi-Newbie
  • *
  • Posts: 48
    • Zerion.net on Facebook
    • @zerionnet on Twitter
    • Zeriyt - Forumi Shqiptar - Zerion
Re: How to export the email addresses from a particular membergroup?
« Reply #10 on: May 28, 2019, 05:58:08 PM »
Thank you guys, but still nothing.
I tried with
Code: [Select]
select email_address from smf_members where id_group = 7 OR FIND_IN_SET(7, additional_groups)
And with
Code: [Select]
select email_address from smf_members where id_group = 7 OR FIND_IN_SET(4, additional_groups)and I get this again and again
Code: [Select]
MySQL returned an empty result set (i.e. zero rows). (Query took 0.0431 seconds.)

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,133
Re: How to export the email addresses from a particular membergroup?
« Reply #11 on: May 28, 2019, 06:11:29 PM »
You'll get an empty result if id_group is not a valid membergroup.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,197
    • StoryBB/StoryBB on GitHub
Re: How to export the email addresses from a particular membergroup?
« Reply #12 on: May 28, 2019, 06:23:36 PM »
And those ids look like post count groups... are they post count groups?
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Study Force

  • SMF Hero
  • ******
  • Posts: 3,655
    • StudyForcePS on Facebook
    • @studyforceps on Twitter
Re: How to export the email addresses from a particular membergroup?
« Reply #13 on: May 28, 2019, 10:15:03 PM »
Posting just to bookmark the topic. Good question and great answers!

Offline aksal

  • Semi-Newbie
  • *
  • Posts: 48
    • Zerion.net on Facebook
    • @zerionnet on Twitter
    • Zeriyt - Forumi Shqiptar - Zerion
Re: How to export the email addresses from a particular membergroup?
« Reply #14 on: May 29, 2019, 07:09:04 AM »
And those ids look like post count groups... are they post count groups?

Yes, post count groups.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,197
    • StoryBB/StoryBB on GitHub
Re: How to export the email addresses from a particular membergroup?
« Reply #15 on: May 29, 2019, 07:38:16 AM »
Would have been nice to know this, since not knowing this wasted everyone’s time thus far.

select email_address from smf_members where id_post_group = 7
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline m4z

  • Jr. Member
  • **
  • Posts: 149
Re: How to export the email addresses from a particular membergroup?
« Reply #16 on: May 29, 2019, 07:47:42 AM »
How/why should a user  or casual admin know there's a difference between postcount-based and normal groups?
« Last Edit: May 29, 2019, 07:58:27 AM by m4z »
"Faith is what you have in things that don't exist."
--Homer Simpson

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,197
    • StoryBB/StoryBB on GitHub
Re: How to export the email addresses from a particular membergroup?
« Reply #17 on: May 29, 2019, 08:01:52 AM »
Because they don’t act like other groups. Also, it’s just courteous to provide as much information up front rather than having to pull it out later.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline aksal

  • Semi-Newbie
  • *
  • Posts: 48
    • Zerion.net on Facebook
    • @zerionnet on Twitter
    • Zeriyt - Forumi Shqiptar - Zerion
Re: How to export the email addresses from a particular membergroup?
« Reply #18 on: May 29, 2019, 11:45:22 AM »
Would have been nice to know this, since not knowing this wasted everyone’s time thus far.

select email_address from smf_members where id_post_group = 7

It worked perfectly now. Thank you very much.