News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Auto Email Inactive Ordinary Users v1.6

Started by karlbenson, December 10, 2007, 12:15:38 AM

Previous topic - Next topic

karlbenson


AUTO EMAIL INACTIVE ORDINARY USERS v1.6
By Karl Benson

Link to Mod | Support TopicDonate

Compatibility
For SMF 1.1.x Only

Introduction
Automatically email inactive users to try to remind/tempt them to come back.

~ Warning ~
Remember to Backup BOTH your DATABASE (structure & data) and your FILES BEFORE installing this mod.
Due to the way this mod works, it MAY affect performance/resource usage/mail servers.
Although currently its working perfectly fine on some very HUGE forums (with 50,000+ members).

Before you request a feature addition...
... please note that this is a SIMPLE Email Inactive Users mod containing pretty much ALL the functionality as I intend to add to the mod.  The only updated versions for this mod will for minor tweaks, language translations, bug fixes and updates for future SMF version support.

How The Mod Works
=> User has not visited for 21 days or more
===> An Initial Email Sent
=====> A further 21 days passes and user still has not visited
=======> A Final Email Sent
=========> A further 21 days passes and user still has not visited
===========> (Optionally) Delete User Account (With a Threshold setting eg Delete users only if they have made less than 10 posts)

Features
o Adds a new section in the admin area (via Admin > Features & Options > AEIOU)
- Note: The mod is disabled straight after installation to enable you to customize the emails and settings.
- Includes Settings:
> Customize Initial Email Subject (text-only) [with replaced variables]
> Customize Initial Email Message (text-only) [with replaced variables]
> Customize Final Email Subject (text-only) [with replaced variables]
> Customize Final Email Subject (text-only) [with replaced variables]
> Enable/Disable Deleting of Users
> Set a Post Threshold
- Other Settings (But NOT recommended to alter)
> Chunksize
> Max Emails To Send Per Hour
> Max Emails To Send Per Day
o Panel showing stats and status of the mod
o Panel showing last 10 inactive users emailed
o Tries to prevent overloading your mail server/exceeding your hourly / daily mail limits
o It does NOT use CRON.
o Anti-spam prevention
- Sending times/periods are hard-coded and cannot be changed
- Limits the no. of emails to be sent out by this mod to TWO.
- User who return after receiving an email have the email process reset (back to 0 email sent)
o Supports Languages
- English/English-utf8
- English_British/English_British-utf8
I welcome translations for other languages. Please post the translated language strings in the Support Topic.

Installation
Any previous versions of this mod MUST be uninstalled BEFORE installing this version.
(Note: Existing database settings will remain. However existing custom emails created in pre-v1.3 will be reset)

Install the mod via the Package Manager to install on ALL themes.
As there are no theme edits for this mod. It only affects Source Files.

If your using a different language than those supported by this mod (listed above), then you will need to add (and translate as necessary) the language strings to your Modifications.{language}.php and/or Modifications.{language}-utf8.php for each theme (The language folder can be found at Themes/{themename}/languages/).

Useful Links
SMF Package Parser
Manual Installation Of Mods
How Do I Modify Files?

Donate
Has this modification helped you? Support the developer by Donating

Common Questions
o Can the periods before and between sending emails be changed?
- No. The periods are hardcoded.  However the periods are ONLY minimums. On large forums, it could be alot longer.
o Whats the minimum period between becoming inactive and user deletion?
- 63 days minimum
- Minimum 21 days to become inactive for sending the initial email
- Minimum 21 days before sending the final email
- Minimum 21 days before deleted user (optionally)
> Note however, it may take longer in each stage depending on the no. of users to email/delete.
o Emails are not being received. Why is it not working?
- A 5 point checklist
1) Get users to check their spam/junk folder. The users mail provider may believe it to be spam.
   > If so, this is not a bug with this mod.  It could be being labelled as spam for several reasons.
2) Even though the mod takes care not to overload your mailserver, it is possible it may have been by SMFs other emailing functions.
   > Email yourself using SMF, if you don't receive the email then it is likely your mailserver is overloaded or not functioning
   > Most hosts have limits (not always publicised) on the no. of emails per hour/day - Contact your host and find out what they are.
   > Sending Newsletters and announcing topics are common ways to overload your mail server.
3) Is the Last 10 Inactive Users Emailed showing recent emails?
   > If it is, then as far as the mod is concerned its working properly.
4) Are there any errors related to it in your error log?
5) Alternatively I am willing to consider it could be a bug. See Support.
o Will this work for SMF 2.0
- No. This mod will need re-writing.  SMF 2.0 will have a task scheduler and mail outbox (which tries to prevent overloading like this mod does).
- So It will need to be more closely integrated with SMF and avoid clashing with other tasks.

Support
Please use the modification thread for support with this modification.
(Please don't ask me to do the edits for you)

Changelog
1.0 - 7th December 2007
o Initial release
o Added Danish/Danish-utf8 (Thanks to Fallen Angel)
1.1 - 13th January 2008
o Fixed lost password link (action=reminder) (Thanks HugoDiaz)
o Added check to only email activated users
o Added check so don't email banned users (by username only)
o Altered order of to whom it send emails.
o Added Brazilian/Brazilian-utf8 (Thanks to tckbm)
o Added Italian/Italian-utf8 (Thanks to TigerRR)
o Added Spanish/Spanish-utf8 (Thanks to minos)
o Added Spanish_es/Spanish_es-utf8 (Thanks to minos)
o Added Turkish/Turkish-utf8 (Thanks to CiOooo)
o Fixed default message/subject on install (to use current language)
1.2 - 16th January 2008
o Fixed so don't email members awaiting account deletion by admin
o Fixed not resetting amount sent per hour/day at same time
o Improved checks for reaching limit
1.3 - 3rd March 2008
o Removed - all non-english language strings (as most the strings have changed)
o Changed the no. of emails sent from 3 to 2 and the dates
o Fixed so doesn't set to max sent, instead uses a different variable
o Added Stats/Status
o Added Last 10 Users emailed
o Added ability to edit BOTH emails
o Added re-activation - so if stopped and admin views aeiou page and theres emails, restart
o Fixed email replacement variables to use preg (so can use mixed case)
o Changed install.php to delete old email variables
o Changed install.php to support manual install using ssi
1.4 - 4th March 2008
o Fixed Times to take users times
o Fixed emails to strip_tags as html would break sending email
o Altered install.xml to reduce conflict with other mods
1.5 - 28th April 2008
o Fixed - Issues where the mod stops (removed lockkey)
o Fixed so admins don't get emailed (even though they wouldn't get deleted)
o Fixed differences between admin vs actual query (takes dateRegistered into account)
o Fixed undefined aeiou_stop
1.6 - 1st May 2008
o Fixed hourly/daily stats not resetting (when down to the last few people)
o Few comment changes
o Few re-ordering of code changes
o Moved call of subs-post.php to only when needed
o Checked works for SMF 1.1.5

minos


Louis EX

Looks interesting, I'll wait till more people to reply to say its okay then I'll download it.

jossanaijr

Thanks,
A few questions before download and install it:

#1 As I understood the 21 days cannot be changed, ok?
#2 Does it shows to whom it will send or had sent the email?
#3 It does not delete inactive accounts, right?

CiOooo

Hello dear friends and the owner of the mod,

I translated the mod in Turkish

If you want to publish the translation, Here It Is ;)

byebye

$txt['aeiou'] = 'AEIOU';
$txt['aeiou_title'] = 'Pasif Üyelere Otomatik Email';
$txt['aeiou_enable'] = 'Pasif Üyelere Email Atma Uygulamasını Etkinleştir';
$txt['aeiou_subject'] = 'Email Konu Başlığı<div class="smalltext">Sadece Yazı (html ve bbcode yok)<br />Kullanılabilir Değişkenler<br />$username, $displayname, $forum, $link, $lostpassword</div>';
$txt['aeiou_message'] = 'Email Mesajı<div class="smalltext">Sadece Yazı (html ve bbcode yok)<br />Kullanılabilir Değişkenler<br />$username, $displayname, $forum, $link, $lostpassword</div>';
$txt['aeiou_delete'] = 'Kullancıları Otomatik Sil (Adminler Hariç)<div class="smalltext">3 email gönderiminden ve son emailden itibaren 30 içinde geri dönülmediği takdirde silmek için kullanılır</div>';
$txt['aeiou_underposts'] = 'Üye Mesajlarını Sil<div class="smalltext">Mesaj Sayısı Daha Az veya Eşit ise</div>';
$txt['aeiou_warning'] = '<b>Bu Ayarları Değiştirmeniz ÖNERİLMEZ</b><div class="smalltext">Emailinizin önem arzetmesi için küçük ebatlarda ve günlük/saatlik limitlere dayanılarak gönderilir..<br />(aktivasyon emailleri, bildiriler, emailler, duyurular, bültenler gibi)<br /> Emailleriniz alınamıyorsa, boutlarını küçültmeyi deneyiniz.</div>';
$txt['aeiou_hour_max'] = 'Saat başına maksimum email<div class="smalltext">Saatte 100 email limiti olan hostlara göre</div>';
$txt['aeiou_day_max'] = 'Günlük maksimum email<div class="smalltext">Günde 1000 email limiti olan hostlara göre</div>';
$txt['aeiou_chunksize'] = 'E maillerin gönderim zamanları<div class="smalltext">5 dakika arayla</div>';
$txt['aeiou_default_subject'] = 'Merhaba $displayname';
$txt['aeiou_default_message'] = 'Merhaba $displayname, Seni $forum platformunda göremez olduk.
Bu nedenle bu kişisel davet ile tekrar döneceğini ümit ediyoruz

$link

Kullanıcı Adın $username.
Şifreni hatırlayamıyorsan $lostpassword adresinden isteyebilirsin.

Saygılar.
$forum staff';



AndyII

Quote from: jossanaijr on December 10, 2007, 08:41:01 AM
Thanks,
A few questions before download and install it:

#1 As I understood the 21 days cannot be changed, ok?
#2 Does it shows to whom it will send or had sent the email?
#3 It does not delete inactive accounts, right?
As far as I see its...
Auto Email Inactive Ordinary Users then delete if not active
Thats OK by me :)
If they are not active for long periods, then don't care who gets deleted, just so long as it only does "In Active" users lol
And THANKS!! for this nice Mod  8)

Fallen Angel

#6
This gonna be a great MOD to alle thos boards there got lots of "ghosts" at thir form..

I jut wanted to install it but gettig an error;

1. Udfør kode install.php 
2. Udfør ændring ./index.php Success
3. Udfør ændring ./Sources/Subs.php Success
4. Udfør ændring ./Sources/Subs-Members.php Success
5. Udfør ændring ./Sources/ModSettings.php Fejl <-- Error
6. Udfør ændring ./Themes/default/languages/Modifications.english.php Success
7. Udfør ændring ./Themes/default/languages/Modifications.english-utf8.php Success
8. Udfør ændring ./Themes/default/languages/Modifications.english_british.php Skipping file
9. Udfør ændring ./Themes/default/languages/Modifications.english_british-utf8.php Skipping file
10. Udfør ændring ./Themes/default/languages/Modifications.danish.php Success
11. Udfør ændring ./Themes/default/languages/Modifications.danish-utf8.php Success


Found and fixed the ERROR my self... Look down...  ;)

minos

#7
here is in spanish

$txt['aeiou'] = 'AEIOU';
$txt['aeiou_title'] = 'Envio Automatico De Correos a Usuiarios inactivos';
$txt['aeiou_enable'] = 'Habilitar El Envio Automatico De Correos a Usuarios inactivos ';
$txt['aeiou_subject'] = 'Personalizar El Asunto Del Correo
<div class="smalltext">Solo Texto (Sin html, Sin bbcode)<br />Variables Disponibles
<br />$username, $displayname, $forum, $link, $lostpassword</div>';
$txt['aeiou_message'] = 'Personalizar El Mensaje Del correo
<div class="smalltext">Solo Texto (Sin html, Sin bbcode)<br />Variables Disponibles
<br />$username, $displayname, $forum, $link, $lostpassword</div>';
$txt['aeiou_delete'] = 'Auto-Eliminar miembros (Excepto Admins)
<div class="smalltext">Despues de Haber Enviado 3 Correos Y no ha regresado dentro de los 30 dias despues del ultimo correo</div>';
$txt['aeiou_underposts'] = 'Limite De Eliminacion De Mensajes Del Usuario
<div class="smalltext">Con Un Conteo De Menajes Menor Que o Igual que.</div>';
$txt['aeiou_warning'] = '<b>No se Recomienda cambiar las caracteristicas de abajo</b>
<div class="smalltext">El Correo es enviado en pequeños pedazos con limites por hora/dia, para asegurar que tu correo IMPORTANTE llegue
<br />(como Correos de Activacion, Notificaciones, Anuncios, Boletines)
<br /> Trate de Reducir la cantidad si tus correos no estan siendo recibidos.</div>';
$txt['aeiou_hour_max'] = 'Max. Correos por Hora
<div class="smalltext">Basado en Host que los limitan a 100 por Hora/div>';
$txt['aeiou_day_max'] = 'Max. Correos por Dia
<div class="smalltext">Basado en hosts que limitan a 1000 por Dia</div>';
$txt['aeiou_chunksize'] = 'Mandar x Correos a la vez
<div class="smalltext">Con un minimo de 5 min. de Intervalo</div>';
$txt['aeiou_default_subject'] = 'Hey $displayname';
$txt['aeiou_default_message'] = 'Hey $displayname, echamos de menos en $forum.
Ha pasado tiempo desde la ultima vez que nos visitaste,Por lo que te enviamos una cordial invitacion para que regreses.

$link

Tu nombre de usuario es $username.
Si haz perdido tu contraseña puedes solicitar una nueva aqui $lostpassword

Saludos
$forum staff';


Fallen Angel

#8
Found the error in ModSettings.php my self:

Before:

$subActions = array(
'invite' => 'ModifyInviteSettings',
'basic' => 'ModifyBasicSettings',
'layout' => 'ModifyLayoutSettings',
'karma' => 'ModifyKarmaSettings',
'ultprofile' => 'ModifyUltProfileSettings',


I juste added:

'aeiou' => 'ModifyAeiouSettings',


After;

$subActions = array(
'invite' => 'ModifyInviteSettings',
'basic' => 'ModifyBasicSettings',
'layout' => 'ModifyLayoutSettings',
'karma' => 'ModifyKarmaSettings',
'ultprofile' => 'ModifyUltProfileSettings',
'aeiou' => 'ModifyAeiouSettings',


Now it works like a charm....  :D ;) ;D

karlbenson

It has surprised me that there has been such a great deal of interest in this mod already.
I fielded responses to about a dozen PM's before it had even been released.  ;)

@fallen Angel
So I guess theres a minor conflict with Ultimate profile.

@jossanaijr
#1 As I understood the 21 days cannot be changed, ok?
The 21 days is hard-coded in seconds.  It should not really be changed.
During my testing with a fake dataset of 2000 members it increased the no. of mails sent out significantly.
I took into account the fact that people do go on holiday for 2 weeks and so you really wouldn't want them emailed.
And 1 month seemed to long.

#2 Does it shows to whom it will send or had sent the email?
Nope,  the mod is intended to be behind the scenes/background. Sending to the most inactive person first

#3 It does not delete inactive accounts, right?
Thats OPTIONAL. (with the additional OPTIONAL setting of choosing a post-count threshold at which posts are deleted.

Fallen Angel

Quote
@fallen Angel
So I guess theres a minor conflict with Ultimate profile.

I guess so, but that was the only error i had, the ModSettings.danish-utf8.php works like a charm. The danish translation works also like a charm, and the installation was without any problems, execpt the "'aeiou' => 'ModifyAeiouSettings'," in ModSettings.php.

Rumbaar

Very nice mod, will be a highly sort after install I'm sure.

Question.  Can you make it so it's not automatic?  Say I want to run it for a fixed period.  Example once a quarter manually run it for all 'inactive' users.

Same for the delete, those that don't respond.  A manual trigger.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

karlbenson

#12
@Rumbaar
Technically you can enable/disable the mod whenever you like via the admin settings.

Once the mod has exhausted sending out all emails it will disable itself until the next day. Then doing another check the next day (and if theres no more, it will do so again).

The aim is to make it run as slow as possible so as not to affect performance, nor overload mail servers.

Having a time-frame to run is completely impractical because it will vary so widely per forum.

From sending the first email, theres a 30 day wait minimum until the next email, and another 30 day wait minimum before the third (and FINAL) email is sent. Only 30 days after that final email (subject to deletion being enabled) does any deletion take place.  So thats a MINIMUM 90 days (quarter) before any accounts will be deleted.

But for large forums with thousands of members (at least initially upon install) it maybe months before you get around to emailing every inactive user.

Depending on how successful the mod is at getting users to return will also impact on the length of time needed to complete a cycle of the mod.

So overall the mod is designed to run on a LONG-TERM basis.

Rumbaar

Ah, so if it was off.  Then 6 months later I turn it on, it will automatically start the process of sending e-mails to all those inactive users (21+day).

How does it affect banned, non-comfirmed, or awaiting approval members?
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

karlbenson

Quote
How does it affect banned, non-comfirmed, or awaiting approval members?

Oops.  It doesn't take those into account. ;)
I'll look into excluding them.

minos

1 day using it and it works cprrectly  thanks

karlbenson

I should also report that privately I've been informed by one user with a 20,000+ member site on Dedicated server that the mod is causing lag and a huge performance hit.

Rumbaar

Quote from: karlbenson on December 10, 2007, 09:26:18 PM
Oops.  It doesn't take those into account. ;)
I'll look into excluding them.
:), also if you are looking at that kind of thing.  Maybe an option to exclude specific membergroups would be a worthwhile addition.  Maybe for a future release.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

mersindost

I Am Simple Machines Hero, Because I LOVE Simple Machines

jossanaijr

#19
Quote from: Fallen Angel on December 10, 2007, 05:34:56 PM
Found the error in ModSettings.php my self:

Before:

$subActions = array(
'invite' => 'ModifyInviteSettings',
'basic' => 'ModifyBasicSettings',
'layout' => 'ModifyLayoutSettings',
'karma' => 'ModifyKarmaSettings',
'ultprofile' => 'ModifyUltProfileSettings',


I juste added:

'aeiou' => 'ModifyAeiouSettings',


After;

$subActions = array(
'invite' => 'ModifyInviteSettings',
'basic' => 'ModifyBasicSettings',
'layout' => 'ModifyLayoutSettings',
'karma' => 'ModifyKarmaSettings',
'ultprofile' => 'ModifyUltProfileSettings',
'aeiou' => 'ModifyAeiouSettings',


Now it works like a charm....  :D ;) ;D

I'm having this error

Fatal error: Call to undefined function: modifyaeiousettings() in /home/mysite/public_html/forum/Sources/ModSettings.php on line 217


This are my 216-217 lines:
   // Call the right function for this sub-acton.
   $subActions[$_REQUEST['sa']]();

A help?


Edit: Solved with Parser.

Advertisement: