Advertisement:

Author Topic: email Inactive Users  (Read 60145 times)

Offline Suki

  • Carthago delenda est
  • Developer
  • SMF Super Hero
  • *
  • Posts: 16,172
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: email Inactive Users
« Reply #240 on: February 18, 2021, 09:30:09 AM »
This is the query used to select which users will get an email:

Code: [Select]
SELECT id_member, email_address, inactive_mail, member_name, real_name, last_login
FROM {db_prefix}members
WHERE inactive_mail = 0
AND posts <= {int:postLimit}
AND last_login < {int:inactiveFor}
AND date_registered < {int:inactiveFor}
AND is_activated = 1
AND to_delete = 0
AND email_address is NOT NULL
AND (id_group IN ({array_int:groups})
OR id_post_group IN ({array_int:groups})
'. (implode(' ', $additionalgroups)). ')',

It is build with several conditionals to prevent false positives or otherwise accidental mass deletion.

The user must meet all these requirements before been eligible for email and deletion.  As you can see, there are important checks such as post limit, the user has to have an email and it must belong to a specific group you select on the mod's admin settings. The user also needs to be active and not marked as received an email previously.

You can use the script provided to test out which validation is preventing from getting the results you expect.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Making tough decisions, so you don't have to.

Offline Sir Osis of Liver

  • SMF Super Hero
  • *******
  • Posts: 11,133
  • We were all equal in the end.
Re: email Inactive Users
« Reply #241 on: June 06, 2021, 07:00:01 PM »
Was playing with this mod 5 days ago to see how it works.  Settings are:

- Disable deletion of users - checked
- Days since last login - 1
- Days since user marked for deletion - 0
- Minimum posts - 0

We don't want to delete members.  Created test user, 1 post, last online 5 days ago.  Today received email.  Not seeing how settings are applied.

“The best laid schemes o' mice an' men / Gang aft a-gley.” - Robert Burns

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,244
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: email Inactive Users
« Reply #242 on: June 10, 2021, 05:37:37 PM »
That seems to have worked as intended then? ???
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.
♥ Jess ♥

STOP EDITING MY PROFILE

Offline Sir Osis of Liver

  • SMF Super Hero
  • *******
  • Posts: 11,133
  • We were all equal in the end.
Re: email Inactive Users
« Reply #243 on: June 10, 2021, 05:51:55 PM »
Dunno, would think if days since last login is 1, should send email every day.  Got one after 5 days, waiting to see if another is sent after 10 days (tomorrow).  Don't think the mod reports emails sent, so there's no way to know if it's actually working.
“The best laid schemes o' mice an' men / Gang aft a-gley.” - Robert Burns

Offline Suki

  • Carthago delenda est
  • Developer
  • SMF Super Hero
  • *
  • Posts: 16,172
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: email Inactive Users
« Reply #244 on: June 18, 2021, 11:24:25 AM »
The mod uses scheduled tasks whoch are only triggered when someone hits the forum, if there is no traffic then no scheduled tasks are triggered and therefore no actions were taken by the mod. Also, the user must meet all the criterias on my previous post for an email to be sent.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Making tough decisions, so you don't have to.

Offline SMiFFER

  • Full Member
  • ***
  • Posts: 470
Re: email Inactive Users
« Reply #245 on: June 26, 2021, 11:19:17 AM »
This is the query used to select which users will get an email:

Thanks!
How would I get the date of the last post that user has made?
At least these 48 (getting more???)steps must be completed for SMF2.1 Final.
Last Full Version: 2.0 Final released more than 10 years ago on 20110604

QUOTE OF Aleksi "Lex" Kilpinen: "That version is old enough to go to school itself."
Quote of the day: A troll is an obstinate bloke who only hungers for your attention. If you feed him, he will puke all over you!

Offline SpacePhoenix

  • Jr. Member
  • **
  • Posts: 224
Re: email Inactive Users
« Reply #246 on: June 26, 2021, 11:59:33 PM »
Never tried this mod myself. One thing you could perhaps add to it if it's not already a part of it, is to have it parse any bounced back emails for the reason why they were bounced back and act on the reason given. For example if it come back as the destination email doesn't exist, then you might want to delete that user (or at least change the user name to something like "Deleted User #" where # is just a unique number to keep from having two identical user names in the DB).

The user email address could perhaps be changed to deleteduser#@made_up_site_name.com where # is the same number. You could perhaps try and mod SMF so that anytime an email is being sent and the email address is for a deleted user, have SMF give an error and not send the email

Offline Nirose

  • Semi-Newbie
  • *
  • Posts: 32
  • Gender: Male
    • The Jucktion
Re: email Inactive Users
« Reply #247 on: July 06, 2021, 09:56:38 PM »
Hi,

Thank you for this mod. it works good but as I set the send-email duration to a slower rate (to prevent being considered spam), it creates duplicate email queue for same users multiple times.

Is there any way to prevent this?