News:

Wondering if this will always be free?  See why free is better.

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.

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.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

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.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

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.

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.

Dave J

Quote from: Shades. on March 25, 2022, 11:45:48 PM
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


@shades,

Did you get this to actually send emails?

I have installed it on 2.1.3 with no errors, I can setup the settings and it says it's sent an email in the log but it doesn't actually send one. I get an error

8: unserialize(): Error at offset 0 of 25 bytes
This is the url causing the issues apparently.

URL of page causing the error
https://********/*******/index.php?action=calendar;viewlist;year=2021;month=8;day=7
If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

Shades.

Quote from: Dave J on June 03, 2023, 10:09:16 AMDid you get this to actually send emails?
I believe I did on 2.1.1 but I don't have it installed anymore, using 2.1.3 now and I don't remember why I uninstalled it because it's been a while lol! But more than likely it was throwing errors and couldn't get to work right on 2.1.3 or I wouldn't have uninstalled it. ;)  ???
 
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

Dave J

Quote from: Shades. on June 03, 2023, 10:28:06 AM
Quote from: Dave J on June 03, 2023, 10:09:16 AMDid you get this to actually send emails?
I believe I did on 2.1.1 but I don't have it installed anymore, using 2.1.3 now and I don't remember why I uninstalled it because it's been a while lol! But more than likely it was throwing errors and couldn't get to work right on 2.1.3 or I wouldn't have uninstalled it. ;)  ???
 

OK thanks for the quick reply Shades much appreciated.

I really could do with a mod like this
If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

Suki

Mod has been updated:

v1.2 support for SMF 2.1.x

No new features were added, just support for 2.1

https://github.com/MissAllSunday/emailInactiveUsers/releases/tag/v1.2

Please report any issues with this new version, will try to address them as time allows it.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Dave J

If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

Dave J

Suki,

There is an issue. For some reason the 'integrate_modify_modifications' hook is not installing.

This is on a clean install, no other mods installed on 2.1.4 running PHP7.4
If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

Suki

Seems its a leftover, weird I didn't catch it while testing. You can safely remove the string "eiu_modifications" from table smf_settings row integrate_modify_modifications.

I'm going to wait a little more before I make a new release in case there are other issues.

Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Dave J

Quote from: Suki on June 25, 2023, 02:34:19 PMSeems its a leftover, weird I didn't catch it while testing. You can safely remove the string "eiu_modifications" from table smf_settings row integrate_modify_modifications.

I'm going to wait a little more before I make a new release in case there are other issues.



Thanks Suki. Removed the integrate_modify_modifications' from hooks.php, reinstalled and seems to be OK. I should have added that the mod did work to send out emails, it was just that error.
If you want quizzes to add to the new SMF2.1 quiz mod go here . There are also walkthroughs in the forum to explain how to install them and other tips.

Advertisement: