News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

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?
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?

Shades.

Hey @Suki any chance to update this for 2.1.1? O:)
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Shades.

#249
Quote from: Shades. on March 25, 2022, 10:26:56 PMHey @Suki any chance to update this for 2.1.1? O:)
Actually I just installed this on a fresh 2.1.1 with a clean database but it won't install on my live site.

I know this only supported for 2.0.9 but maybe someone can tell me what to do with this error...

After clicking the 2nd install in package manager I get:

QuoteData truncated for column 'inactive_mail' at row 2
File: /home2/*****/public_html/*****/Packages/temp/install.php
Line: 38

Edited to say: I figured it out! ;)

Had to delete these old columns in smf_members from when my forum was 2.0.19 and then it installed.

inactive_mail
sent_mail
to_delete
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

lagunaclubnl

files are on right position, dbase valeus are ok still got this error:

De callable eiu_modifications kon niet aangeroepen worden. and
Hook-aanroep: functie "eiu_modifications" in bestand /home/xxxxxxxxxxx/domains/lagunaclub.nl/private_html/forum kon niet worden aangeroepen.

Called from:
xxxxs://www.lagunaclub.nl/forum/index.php?action=admin;area=modsettings;sa=realpopup;xxxxxx=xxxxxxx


I am using SMF2.1.1, Tinyportal and realpopup.

Doug Heffernan

Quote from: lagunaclubnl on April 04, 2022, 07:00:24 AMfiles are on right position, dbase valeus are ok still got this error:

De callable eiu_modifications kon niet aangeroepen worden. and
Hook-aanroep: functie "eiu_modifications" in bestand /home/xxxxxxxxxxx/domains/lagunaclub.nl/private_html/forum kon niet worden aangeroepen.

Called from:
xxxxs://www.lagunaclub.nl/forum/index.php?action=admin;area=modsettings;sa=realpopup;xxxxxx=xxxxxxx


I am using SMF2.1.1, Tinyportal and realpopup.

This mod is not compatible with smf 2.1.x.

Advertisement: