• Welcome to Simple Machines Community Forum. Please login or sign up.

email Inactive Users

Started by Suki, April 19, 2014, 02:00:47 PM

Previous topic - Next topic

Suki

This is the query used to select which users will get an email:


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.

Sir Osis of Liver

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

Ninja ZX-10RR

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

Sir Osis of Liver

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

Suki

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.

SMiFFER

Quote from: Suki on February 18, 2021, 09:30:09 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!

SpacePhoenix

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

Nirose

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?

Advertisement: