Advertisement:

Author Topic: email Inactive Users  (Read 58813 times)

Offline Suki

  • Carthago delenda est
  • Lead Developer
  • SMF Super Hero
  • *
  • Posts: 16,125
  • 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,075
  • 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,232
  • 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,075
  • 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