Advertisement:

Author Topic: email Inactive Users  (Read 41900 times)

Offline Miker1029

  • Jr. Member
  • **
  • Posts: 165
  • Gender: Male
    • http://www.facebook.com/428239094034539 on Facebook
    • https://plus.google.com/+Android-x86Net/about on LinkedIn
    • @AndroidX86Forum on Twitter
    • Android - X86 Forums
Re: email Inactive Users
« Reply #160 on: August 27, 2015, 04:36:42 PM »
Ya I've done manually even set it to 10 days, uninstalled reinstalled still nothing....

I did redo some user permissions yesterday thinking that might be it...

Csn you tell me all the db entries?  Or does the remove data on uninstall handle them all?

Thinking uninstall and remove all settings associated with the mod and reinstall.

And I can give you my thanks for the mod. It is useful..

Mike

Offline Suki

  • SMF Super Hero
  • *******
  • Posts: 14,976
  • Kaizoku Jotei
    • SMF mods
Re: email Inactive Users
« Reply #161 on: August 28, 2015, 10:24:53 AM »
Reinstalling it won't do anything, perhaps the only thing it will do is having duplicate code on your forum which will create yet more issues.

Read this topic, I already explained what the criteria is and even posted a few scripts to help debugging.


As for mails and the mail queue, once this mod calls SMF's sendmail() function the mod cannot do anything beyond that, once again, reinstalling it won't do anything. The mails this mod sent are already on SMFs mail queue so uninstalling the mod won't change that.

This mod cannot possible know if an user's mail is indeed a valid one, it just checks that the user has an email address.
I'm not a criminal.
I'm not a rapist.

Offline Miker1029

  • Jr. Member
  • **
  • Posts: 165
  • Gender: Male
    • http://www.facebook.com/428239094034539 on Facebook
    • https://plus.google.com/+Android-x86Net/about on LinkedIn
    • @AndroidX86Forum on Twitter
    • Android - X86 Forums
Re: email Inactive Users
« Reply #162 on: May 29, 2016, 08:23:52 PM »
Hey all,

    We were talking about this earlier, and figured I'd post here for folks still using the mod...

I've changed the delete dates from 6 months/0 posts, to 1 year 50 posts, and thought, HELL, without a Check all option that's gonna hurt....

SOOO I went searching, and since I stink at coding I found a Javascript that will do the job, and I made a Bookmarklet out of it....

SO Basically Create a Bookmark by Hand... call it what you want, Mines CMT (Check Mark Toggle)

Paste this code in the Link and Viola, Check mark toggle for any page you go to....

Code: [Select]
javascript:(function(){
function checkFrames(w) {
 
  try {
    var inputs = w.document.getElementsByTagName('input');
    for (var i = 0; i < inputs.length; i++) {
      if (inputs[i].type && inputs[i].type == 'checkbox'){
        inputs[i].checked = !inputs[i].checked;
      }
    }
  } catch (e){}
  if(w.frames && w.frames.length>0){
   
    for(var i = 0; i < w.frames.length;i++){
      var fr = w.frames[i];
      checkFrames(fr);
    }
  }
}
checkFrames(window);
})()

I closed the link to the source, so I can't post it, but this was by no means created bv me, The Implementation Was, But that's cause I couldn't make a code call work.... And Actually I kind of like this better....

Hope It helps someone, as this could be used in MANY situations.....

Mike

Offline aegersz

  • Sr. Member
  • ****
  • Posts: 907
  • Gender: Male
    • dopetalk
Re: email Inactive Users
« Reply #163 on: August 05, 2016, 06:41:21 AM »
ignore me as i didn't check all the appropriate membergroups and now it's working fine !

« Last Edit: August 05, 2016, 06:58:12 AM by aegersz »
"mods" junkie (SMF 2.0) with 130 on (the full List can be seen at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline Miker1029

  • Jr. Member
  • **
  • Posts: 165
  • Gender: Male
    • http://www.facebook.com/428239094034539 on Facebook
    • https://plus.google.com/+Android-x86Net/about on LinkedIn
    • @AndroidX86Forum on Twitter
    • Android - X86 Forums
Re: email Inactive Users
« Reply #164 on: August 05, 2016, 07:46:38 PM »
Should I not waste my time posting Fake E-Mail Texts here?

Mike

Offline Suki

  • SMF Super Hero
  • *******
  • Posts: 14,976
  • Kaizoku Jotei
    • SMF mods
Re: email Inactive Users
« Reply #165 on: August 06, 2016, 08:57:10 AM »
Thats up to you, no time is wasted unless you decide to mark it as such.

Having said that, I cannot think of a reason for posting fake email texts or rather, what would be the purpose of doing so.  This mod is not a spamming oriented mod and shouldn't be used to prevent/control spam.
I'm not a criminal.
I'm not a rapist.

Offline Miker1029

  • Jr. Member
  • **
  • Posts: 165
  • Gender: Male
    • http://www.facebook.com/428239094034539 on Facebook
    • https://plus.google.com/+Android-x86Net/about on LinkedIn
    • @AndroidX86Forum on Twitter
    • Android - X86 Forums
Re: email Inactive Users
« Reply #166 on: August 06, 2016, 09:35:36 AM »
Oh Damn, Sorry, I posted on the wrong thread!!!!!!!!!

I thought this was "e-mail username", and I've been working on trying to keep up with the 1000's of fake address for that mod, and uploading them, then I came here and they're GONE!!! Imagine my surprise!!!  LOL

Explains why they are gone!

Mike

Offline elexx

  • Newbie
  • *
  • Posts: 1
Re: email Inactive Users
« Reply #167 on: August 25, 2016, 04:39:40 AM »
Hello, thank you for this mod!

It works on SMF 2.0.11 but with a little Problem:

The {last_login} variable would not be replaced correctly - the place ist empty.

My custom Mail body is like follows:
Quote
Hallo {user_name},
Du warst schon lange nicht mehr im Forum aktiv (zuletzt am {last_login} ).

Klick: {forum_url}

Viele Grüße ..

The replacement of {user_name} and {forum_url} works. I've looked in the ScheduledTasks.php an found the code for replacement:

Code: [Select]
// Lets create the message. Replace our wildcards with the actual data.
$replacements = array(
'{user_name}' => $row['real_name'],
'{display_name}' => $row['member_name'],
'{last_login}' => timeformat($row['last_login']),
'{forum_name}' => $mbname,
'{forum_url}' => $scripturl,
);

I think, timeformat() returns with an empty string, but why?

Does anybody use this variable, (it's not used in the default message)?

Offline Suki

  • SMF Super Hero
  • *******
  • Posts: 14,976
  • Kaizoku Jotei
    • SMF mods
Re: email Inactive Users
« Reply #168 on: August 25, 2016, 11:13:38 AM »
I believe the last_login row will never be filled for accounts that register but never ever come back again.

A quick fix for those cases would be:

Code: [Select]
<?php

$request $smcFunc['db_query']('''
SELECT id_member, email_address, inactive_mail, member_name, real_name, last_login, date_registered
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)). ')',
array(
'inactiveFor' => $today $inactiveFor,
'groups' => $inGroups,
'postLimit' => $postLimit,
)
);
$messages = array();
while($row $smcFunc['db_fetch_assoc']($request))
{
// Lets create the message. Replace our wildcards with the actual data.
$replacements = array(
'{user_name}' => $row['real_name'],
'{display_name}' => $row['member_name'],
'{last_login}' => timeformat(!empty($row['last_login']) ? $row['last_login'] : $row['date_registered']),
'{forum_name}' => $mbname,
'{forum_url}' => $scripturl,
);
I'm not a criminal.
I'm not a rapist.

Offline Tones

  • Semi-Newbie
  • *
  • Posts: 14
Re: email Inactive Users
« Reply #169 on: October 02, 2016, 10:06:13 AM »
What I'd like to do is not just send a mail to the member but also one to the webmaster so there's a record one was sent. I'm just unsure how to do this.

Code: [Select]
$messages[$row['id_member']] = array(
'message' => str_replace($find, $replace, $customMessage),
'mail' => $row['email_address'],
'subject' => str_replace($find, $replace, $customSubject),
);

I'm assuming the mail line needs to be an array though without hardcoding in an email address i don't know how to place the webmaster email in there.
Code: [Select]
'mail' => array($row['email_address'], $modSettings['webmaster_email']),

Am i even close and would that be the variable to use for the forums email address?
« Last Edit: October 02, 2016, 10:32:43 AM by Tones »

Offline SMiFFER

  • Jr. Member
  • **
  • Posts: 209
Re: email Inactive Users
« Reply #170 on: October 13, 2016, 04:26:27 PM »
Nice mod.

Question:
Could you include a function to remind/auto-purge members that have not posted since x days ?
...coming from VB, using SMF since 2012, now hosting it myself
currently 2.0.14

Offline blunted

  • Jr. Member
  • **
  • Posts: 201
Re: email Inactive Users
« Reply #171 on: October 21, 2016, 10:35:08 AM »
Every time I select groups, hit save, none are selected at options.
Is this normal?

Offline Suki

  • SMF Super Hero
  • *******
  • Posts: 14,976
  • Kaizoku Jotei
    • SMF mods
Re: email Inactive Users
« Reply #172 on: October 24, 2016, 12:49:53 PM »
No, is there any error on your error log?   what SMF version are you using?
I'm not a criminal.
I'm not a rapist.

Offline CrescentEclipse

  • Semi-Newbie
  • *
  • Posts: 74
  • Gender: Male
Re: email Inactive Users
« Reply #173 on: October 26, 2016, 04:19:18 AM »
Hello Suki :)

I have some questions about your mod.
First of all, the mod works like intended on SMF 2.0.12. No problems at all. Great mod, thank you for your effort! :D

Is it possible to easily disable the minimum post count?
I think it is a bit redundant when you have post count based membergoups, which are very common.
On the other hand it could be handy if you could set a different behavior for users with a higher post count.
(no deletion, only inform)

The next thing is, and many people here seem to have the same opinion, it is confusing to only see the users marked for possible deletion after the grace period expired. Is it possible to somehow enhance the user list by showing some categories?

Maybe something like this:

1. A list with informed users
2. A list with users marked for possible deletion
3. A list with users who will be deleted on next task run
4. A list with users who are protected (maybe with a reset button?)

I think this will give you a nice overview what is currently going on. This is only an idea.
It would be great to have such features, to give this mod a perfect finishing.

Some additional information:
Hm, I found a text variable, which is not used in the mod: $txt['eiu_list_will_be_deleted'] (planned feature, like it suggested?)
$txt['eiu_list_title_potential'] and $txt['eiu_list_title'] are used for the user list (in the menu and in the list itself). Maybe one should be enough?

If you are interested, I can provide a german translation as well ;)

Thank you again for this nice mod. It is a mystery that this is not a standard feature of SMF.

lg Cres
« Last Edit: October 26, 2016, 04:29:44 AM by CrescentEclipse »

Offline Suki

  • SMF Super Hero
  • *******
  • Posts: 14,976
  • Kaizoku Jotei
    • SMF mods
Re: email Inactive Users
« Reply #174 on: October 27, 2016, 10:12:34 AM »
Yeah, those are nice features and are doable, unfortunately, I do not have the time to implement them.
I'm not a criminal.
I'm not a rapist.

Offline SMiFFER

  • Jr. Member
  • **
  • Posts: 209
Re: email Inactive Users
« Reply #175 on: October 30, 2016, 07:33:17 AM »
Yeah, those are nice features and are doable, unfortunately, I do not have the time to implement them.
What if we share that work then?
...coming from VB, using SMF since 2012, now hosting it myself
currently 2.0.14

Offline Suki

  • SMF Super Hero
  • *******
  • Posts: 14,976
  • Kaizoku Jotei
    • SMF mods
Re: email Inactive Users
« Reply #176 on: October 31, 2016, 01:33:56 PM »
The mod has always been open source
I'm not a criminal.
I'm not a rapist.

Offline Paracelsus

  • Sr. Member
  • ****
  • Posts: 874
  • Gender: Male
Re: email Inactive Users
« Reply #177 on: November 11, 2016, 10:46:22 AM »
Hi Suki,

Quick question, how do I "reset" the list of inactive users that have already received the email? I use this MOD not to dele the users but as a reminder to visit the forum. Since last time most of them got the email was ages ago, I wanted to send them once more.

Offline aegersz

  • Sr. Member
  • ****
  • Posts: 907
  • Gender: Male
    • dopetalk
Re: email Inactive Users
« Reply #178 on: November 12, 2016, 03:01:40 AM »
Just increase (backdate) your time limit to catch them again, that's my guess.
"mods" junkie (SMF 2.0) with 130 on (the full List can be seen at http://forum.drugs-and-users.org/index.php/topic,3301)

Offline romanos8

  • Semi-Newbie
  • *
  • Posts: 34
Re: email Inactive Users
« Reply #179 on: November 28, 2016, 07:57:58 PM »
Can you tell me the name of the tables in database ? because I am getting the following  error:

Duplicate entry 'emailInactiveUsers' for key 'task'


Maybe I had installed the same mode.