Advertisement:

Author Topic: email Inactive Users  (Read 55201 times)

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,597
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: email Inactive Users
« Reply #220 on: February 05, 2018, 04:02:41 PM »
The log you sent is telling theres a duplicated function in the ScheduledTasks.php file but there isn't in the file you attached.

You need to attach the real file you are using or at least tell me if you did something else since you attached it.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline petewadey

  • Jr. Member
  • **
  • Posts: 169
Re: email Inactive Users
« Reply #221 on: February 05, 2018, 04:13:49 PM »
I realize there is a duplicate file, and I'm trying with the help of my host to remove all traces and install a fresh copy. If this fails, I will probably give up, as it's beyond my capability to sort this. Shame because I would really like to run this mod.
Anyway, I'll try one more time from scratch.
I will let you know how I get on.
Pete

Offline aegersz

  • SMF Hero
  • ******
  • Posts: 1,581
  • Gender: Male
  • the "mods and tweaks" junkie
    • dopetalk
Re: email Inactive Users
« Reply #222 on: February 05, 2018, 04:16:31 PM »
Hi, i'm still experiencing inconsistencies with this mod - it worked fine ages when my member base was smaller but now it's producing less emails.

what do you suggest is best to debug it without producing emails etc. ?

i don't really want to commit to queuing up real emails to send, i don't know if it is possible to just echo the candidate members name out somewhere, a temp table maybe ?

thoughts on getting it to do a "dry" run before the real one ?

The configuration of my Linux VPS (SMF 2.0 with 145 mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,597
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: email Inactive Users
« Reply #223 on: February 06, 2018, 10:47:07 AM »
You can copy all the logic inside the scheduled task into a separate file, include all the files the scheduled task calls and replace the actual query to delete members with a var_dump() of the array that holds the ids or do a query with those ids to the memebrs table to get their names
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline aegersz

  • SMF Hero
  • ******
  • Posts: 1,581
  • Gender: Male
  • the "mods and tweaks" junkie
    • dopetalk
Re: email Inactive Users
« Reply #224 on: February 06, 2018, 04:10:55 PM »
excellent. i didn't know where to start but have used var_dump() to debug in the past.

it's on my "to do" list.

thanks Suki !
The configuration of my Linux VPS (SMF 2.0 with 145 mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

Offline @rjen

  • Full Member
  • ***
  • Posts: 550
  • Gender: Male
    • FJR-club Nederland
Re: email Inactive Users
« Reply #225 on: June 10, 2018, 12:21:52 PM »
I am considering to use this MOD.

There is one thing I cannot figure out though: I want to sent the reminders to all 'Regular members' , ie the ones that are NOT part of any membergroup.
Can that be done? And if so, how?

Thanks in advance...
Running SMF 2.0 with Tinyportal 1.6.5 at www.fjr-club.nl
Testing SMF 2.1 RC2 with Tinyportal at http://test2.fjr-club.nl/

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,597
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: email Inactive Users
« Reply #226 on: June 10, 2018, 03:40:18 PM »
No, you need to specifically select the user groups you want to target, the mod was designed like that from the beginning.
« Last Edit: June 10, 2018, 04:20:01 PM by Suki »
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline @rjen

  • Full Member
  • ***
  • Posts: 550
  • Gender: Male
    • FJR-club Nederland
Re: email Inactive Users
« Reply #227 on: June 10, 2018, 03:51:53 PM »
That’s too bad : I specifically want to to target the users NOT in a usergroup...

well actually in the group 'Regular Members'  which is not in the picklist of the mod...
« Last Edit: June 10, 2018, 04:23:22 PM by @rjen »
Running SMF 2.0 with Tinyportal 1.6.5 at www.fjr-club.nl
Testing SMF 2.1 RC2 with Tinyportal at http://test2.fjr-club.nl/

Offline aegersz

  • SMF Hero
  • ******
  • Posts: 1,581
  • Gender: Male
  • the "mods and tweaks" junkie
    • dopetalk
Re: email Inactive Users
« Reply #228 on: September 08, 2018, 11:50:00 AM »
FYI, I wrote a (suitable for VPS users) quick-and-dirty batch version of the emailer as it may handy and/or of interest to somebody:

Code: [Select]
<?php
$servername 
"localhost";
$username "?";
$password "?";
$dbname "?;
$tbpref = "?_";

// SET THESE TOO !
$days_not_logged_in = 365;
$do_email = 0;
// ---------

$connect = new mysqli($servername$username$password$dbname);
if (
$connect->connect_error) {
        die("
Connection failed" . $connect->connect_error);
}

$sql = "SELECT FROM" . " " . $tbpref . "members ORDER BY last_login";

$result = $connect->query($sql);

if (
$result->num_rows > 0) {
        while(
$row = $result->fetch_assoc()) {
                if (!empty(
$row["last_login"])) {
                        
$dateSin =  $row["last_login"];
                        
$current_date = date("U") /* to have it in microseconds */;
                        
$your_month = date("m", $dateSin);
                        
$your_day =  date("d", $dateSin);
                        
$your_year =  date("Y", $dateSin);
                        
$selected_date_stamp = mktime(0,0,0,$your_month,$your_day,$your_year);
                        
$selected_date = date("U",$selected_date_stamp);
                        
$difference = round (($current_date - $selected_date)/(3600*24));
                        if (
$difference >= $days_not_logged_in) {
                                echo 
$row["member_name"] . " " . $row["email_address"] . " " . "posts=" . $row["posts"] . " ";
                                echo "
Last logged in" . " " . $difference . " " . "days ago" . PHP_EOL;
                                
$to_member =  $row["member_name"];
                                
$from_name = "SMF Administrator";
                                
$from_email = "smfadmin@site-name";
                                
$headers = "From$from_name <$from_email>";
                                
$body = "Dear $to_member, \n
We miss you 
as you have not logged in to https://site-name for over $difference days. \n
Your membership is safe however you may be deleted from the forum some time in the future if you remain inactive.
Of course you will be given ample warning should that be the case. \n
Come 
and visit us if you are bored :-) \n
Regards
, \n
Server Admin
";
                                
$subject = "Regarding your last login to site_name";
                                
$to_email = $row["email_address"];
                                if (
$do_email) {
                                        if (mail(
$to_email$subject$body$headers)) {
                                                echo "
(email sent)" . " ";
                                        } else {
                                                echo "
(email failed)" . " ";
                                        }
                                }
                        }
                }
        }
} else {
        echo "
0 results";
}

$connect->close();
?>

« Last Edit: September 08, 2018, 12:06:40 PM by aegersz »
The configuration of my Linux VPS (SMF 2.0 with 145 mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

Offline aegersz

  • SMF Hero
  • ******
  • Posts: 1,581
  • Gender: Male
  • the "mods and tweaks" junkie
    • dopetalk
Re: email Inactive Users
« Reply #229 on: September 08, 2018, 09:02:27 PM »
risky but seems to work for me (it just inspires condidence  :P)

batch php emailer/delete/report members who have NEVER logged in
The configuration of my Linux VPS (SMF 2.0 with 145 mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,754
Re: email Inactive Users
« Reply #230 on: November 30, 2018, 11:11:46 AM »
Getting this error on messy forum -


http://www.forum.com/index.php?action=admin;area=eiu;sa=general2
2: in_array() expects parameter 2 to be array, boolean given
File: /home/forum/public_html/Themes/default/Admin.template.php
 Line: 909


Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,597
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: email Inactive Users
« Reply #231 on: December 22, 2018, 02:10:48 PM »
What SMF version are you using? I recall there was a bug with adding a select option, upgrade to the latest available SMF version or just set an option and save.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline SMiFFER

  • Full Member
  • ***
  • Posts: 410
Re: email Inactive Users
« Reply #232 on: December 19, 2019, 07:00:37 PM »

3 years later, how about now?  :laugh:

Nice mod.

Question:
Could you include a function to remind/auto-purge members that have not posted since x days ?
QUOTE OF Aleksi "Lex" Kilpinen: "That version is old enough to go to school itself."
At least these 6 steps need to be done for SMF2.1 RC3. And these 74 for SMF2.1 Final.
Last Full Version: 2.0 Final released 8 years ago on 20110604

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,597
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: email Inactive Users
« Reply #233 on: December 20, 2019, 10:20:21 AM »
Fair enough :P
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline acmirapt

  • Newbie
  • *
  • Posts: 3
Re: email Inactive Users
« Reply #234 on: December 20, 2019, 12:30:40 PM »
I've downloaded this plugin in Monday, and i've been planning to run it to clean a User Database with lots of users since 2005  :-X

But i have a question. This will delete only users or users and his posts and content? Or it will put the users replys and topics as Visitor state?

Thanks!  8)

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,597
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: email Inactive Users
« Reply #235 on: December 21, 2019, 09:34:22 AM »
Hi, welcome to SMF.

This mod follows SMF's deletion process (as of SMF 2.0.15), meaning their posts won't be deleted but marked as "guest post" or visitor state as you call it.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline acmirapt

  • Newbie
  • *
  • Posts: 3
Re: email Inactive Users
« Reply #236 on: December 21, 2019, 06:07:57 PM »
I've all the settings done, the emails are sent yesterday at 1AM.

Now, in the plugin Users List i dont have any List. It only says
"There aren't any users marked for potential deletion"

Why this happen? I've checked the DB and smf_members table and there are some users with 1 in user deletion column.

Can you help? Its possible to do List and delete in another Way?? I dont want to send another email to users, because some of them Will report that as spam and other mais are returned (maybe there's no email account anymore)

Thanks for your help.

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,597
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: email Inactive Users
« Reply #237 on: December 22, 2019, 11:03:56 AM »
The mod does the deletion in two steps, first it sends an email to those users that hasn't been logged since X days, then some more time passes, the "grace period" where users can indeed log in and they will no longer be counted for deletion.

Only those users who who received the mail and still hasn't logged in will be counted towards deletion.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline acmirapt

  • Newbie
  • *
  • Posts: 3
Re: email Inactive Users
« Reply #238 on: December 23, 2019, 04:43:14 AM »
Thanks for your help Suki. So after the grace period that i've selected in the settings the users to listed for deletion / inactive will appear in the list.

Thanks again!  8)