PDA

View Full Version : Mini Mods - Email Reminder for inactive users


TalkVirginia
05-26-2011, 10:00 PM
Like others before me, I've been using this mod quite a while on previous versions of vBulletin. Since updates and support for older versions had stopped, I figured I would make my own modifications and help others that have enjoyed it as well. I want to add back in some of the previous functionality that has been left out as well as add some new functionality. This mod for the most part picks up where the 3.7.x version leaves off.

What does it do?
=====================================
This mod will send out reminder emails to inactive members to encourage them to come back to your site. This is now only based on member's last activity date.

*** See Updates section below for new feature list per release. ***

IF YOU HAVE QUESTIONS OR PROBLEMS WITH THE ADDON, PLEASE LET ME KNOW.

PLEASE DON'T FORGET TO CLICK THE INSTALLED LINK AND DON'T FORGET TO NOMINATE MOTM!!
THANK YOU!!

Features
The following features are updatable through the AdminCP.
=====================================
* Turn Product on/off.

* Set the number of days a user can be inactive (grace period) before email is sent.
Example: Inactivity Graceperiod is set for 60 days. On day 61, member Bob will begin receiving reminder emails.

* Send Email Once.
If this is set, when members become inactive they will receive one reminder only.

* Set how often an reminder email is sent after an inactive member has received their first reminder.
Example: Inactivity Grace period is set for 60 days, and Reminder Email frequency is set for 30 days. On day 61, member Bob will receive his first reminder email letting him know he has been inactive for over 60 days asking him to come back to see your new content. If Bob, continues to be inactive, Bob will receive reminder emails based on the number of days you have the email frequency set to. If set to 30 days, members will receive reminders every 30 days after their first reminder.

* Set reminder email format - TEXT or HTML.

* Set the reminder email subject. (phrased)

* Set the reminder email body. (phrased)

* Set the usergroups to be sent a reminder email.

* Set Userids to exclude.

* Edit number of emails send totally (Max Reminders)
Example: If the Send Once option is set to false, and this option is set to 50. Inactive members will only receive 50 reminders.

* Keep a log of all inactive users contacted

* Opt-Out Feature for members - Include an opt-out link in reminder email. (Thanks to Gene Steinberg)

Install Instructions
--------------------------
1. Upload file in the upload folder to the forums folder on your server.

2. In your AdminCP:
a. Go to Plugs & Products -> Product Manager -> Add New Product.
c. Import the product xml from the zip file. (make sure to use overwrite)
3. The mod is disabled by default on install so you will need to enable it. Go to Vbulletin "Settings" -> Options -> Inactivity Reminder Emails.

4. Settings and the inactivity log viewer are also available on the left menu just above the users settings group.

5 Mark as Installed (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=237531)

6 Please Nominate for MOTM (https://vborg.vbsupport.ru/vborg_miscactions.php?do=nominate&threadid=237531&type=1)

=======================================
Update 2.1.5 - Initial Release for VB 3.8.x

Credits & Previous Updates
======================================
Updates and fixes that have been carried over from version 1.1.3 can be found at the link below.
https://vborg.vbsupport.ru/showthread.php?t=180025&highlight=email+reminder (https://vborg.vbsupport.ru/showthread.php?t=180025&highlight=email+reminder)

I also want to give full credit and thanks to the developers of the previous versions 1.0.6 to 1.1.3 from which this was derived:

C Braithwaite (https://vborg.vbsupport.ru/member.php?u=126221)
robertjandreu (https://vborg.vbsupport.ru/member.php?u=230904)

PLEASE DON'T FORGET TO CLICK THE INSTALLED LINK.

TalkVirginia
05-27-2011, 02:28 AM
Inactive User Reminder Emails Tutorial

This is a sort of intro tutorial on this mod. If you have further questions, haven't made something clear, please let me know and I'll add it to this write up.

Inactive Reminders Menu Group
First up, as you can see from this screen, you can find the settings in it's own menu group just above the vBulletin Users menu group. You can also find it by going to the vBulletin "Settings" menu group at the top.

http://www.talkvirginia.net/images/reminderimages/admincpmenu.png

How does processing occur?
This mod uses an scheduled Cron Job called "Inactive User Reminder Emails" and can be found in the Scheduled Tasks Manager. When installed, it's configured to run nightly at 1:30am.

http://www.talkvirginia.net/images/reminderimages/reminder_cronjob.png


Enabling the mod
This mod is disabled by default on first-time install. If you are upgrading from a previous version, you should still make sure it's enabled. In addition, you should do a save even if no settings are changed to save settings for any new features.

http://www.talkvirginia.net/images/reminderimages/reminder_enable.png


Batch Processing
This comes into play if you have a large site and don't want to overwhelm your host with 20k or more worth reminder emails sent at one time. This feature will allow you to set the amount of reminders sent out during each scheduled cron job

http://www.talkvirginia.net/images/reminderimages/reminder_batch.png


Send Reminder Emails Once Only
If you want to send out reminders only one time to your members after they have become inactive, you can do this by setting this option to yes.

http://www.talkvirginia.net/images/reminderimages/reminder_sendonce.png

Maximum Email To Send
If you set the option above to No, then this option will be used. Set this to any amount greater than zero and that is all your inactive members will receive. Set it to 3, and once the counter reaches 3, no more reminders will be sent.

https://vborg.vbsupport.ru/external/2011/05/6.png


Inactivity Grace Period
This allows you to set a variable threshold or number of days before your members are consided to be inactive. I would recommend setting this to 30 days or higher. Once they have not logged in for this many days, on the following day they will start receiving reminder emails.

https://vborg.vbsupport.ru/external/2011/05/6.png

Inactivity based on Last Post *REMOVED*

If this is set to Yes, then user inactivity will be determined by the date which they last posted. Users will begin receiving reminders the day after the number of days set for Inactivity Grace Period, if they haven't posted within that amount of time. If this is set to No, then Inactivity will be based on the last time the user visited your site.

Inactivity is now based on Last Activity Date only. If you feel that inactivity should be based on something else, please let me know what, and why and I will think about changing it but this seemed to be the most logical at the time.

http://www.talkvirginia.net/images/reminderimages/reminder_lastpost.png

How often should reminder emails be sent?
After users have become inactive either based on last post or their last activity on your site, reminder emails will be sent every x number of days set here. If you set this option to 7, users will receive email reminders once a week, after their initial reminder has been received, until they log in again and/or make a post.

http://www.talkvirginia.net/images/reminderimages/reminder_frequency.png

Usergroups to receive reminder emails
This option is required. You will need to specify which Usergroup IDs are to receive inactivity reminder emails. IDs must be separated with a comma.

http://www.talkvirginia.net/images/reminderimages/reminder_usergroups.png

Exclude User IDs
If there is a user in one of the Usergroups specified above, that you do not want to receive reminder emails, you can indicate that here.

http://www.talkvirginia.net/images/reminderimages/reminder_excludeuserids.png

Email Format
This option enables you to set the format that users receive reminders in, as well as the format that admins receive notification that this addon is working. You can set this to either TEXT or HTML. This will not affect other emails that are sent out through vBulletin. I have included sample reminder email content, however reminder emails use vBulletin phrases so thay can be customized as you like. You can change them by clicking on the links shown here with this option, or through the vBulletin Phrase Manager. The phases are located in the Email Subject and Email Message phrase groups. The phrases this mod installs are called inactivity_reminder_plaintext and inactivity reminder_html. They are called the same in both phrase groups. You may alter the contents of these phases however please do not change the names. You may include variables such as $username, $userid, $email, $bbtitle, $homeurl, $forumurl, and $hometitle. If you would like to include other information in your content, please let me know and I'll will look into adding it in future versions.

http://www.talkvirginia.net/images/reminderimages/reminder_emailformat.png


Enable Admin Email Report: This option gives you the choice of receiving an admin report with a list of members that were sent inactivity reminders.

Enable Logging: This will allow you to turn logging on and off. This records who have been sent reminder emails.

Inactivity Log Duration: How many days do you want to keep in the log. Each time the Cron Job runs and emails are sent out, users will recorded in the log, then any entries older than the number of days indicated here will be automatically purged.

That's about it. Any questions? Comments? Any features requests? :)

I want to thank everyone that has downloaded and is using this mod on their site. Your constructive comments, both positive and negative, give me a lot of encouragement to do more and do better.

FreshFroot
05-27-2011, 06:11 AM
Thanks been waiting for awhile and this is great! :D

Hornstar
05-27-2011, 08:19 AM
Yeah I might give this a go and see how it goes. A little worried what it might do to server load with having over 600 000 members.

TalkVirginia
05-27-2011, 08:54 AM
Yeah I might give this a go and see how it goes. A little worried what it might do to server load with having over 600 000 members.

If you can find a good balance of emails to send at one time or multiple times during the day. If my math serves correct... :) example: 600000/(24*7) = 4000 emails / 24 = 166.6 per hour) You should be able to handle more than that I would think.

MagicThemeParks
05-27-2011, 10:54 AM
Thanks Jim! :up:

I'll be downloading it and installing it probably this weekend :D

TalkVirginia
05-27-2011, 11:29 AM
Thanks Jim! :up:

I'll be downloading it and installing it probably this weekend :D

You're most welcome! :)

MrAd
05-27-2011, 06:07 PM
Installed. thanks!

MrAd
05-27-2011, 06:09 PM
Also nominated! Great mod, thanks again Jim!

MrAd
05-27-2011, 06:31 PM
first Bug, I get the following Error

Fatal error: Class 'vB_Template_Runtime' not found in xxxx/public_html/admincp/inactivitylog.php on line 112

MrAd
05-27-2011, 06:51 PM
one more bug, when a user want to opt himself out

Fatal error: Call to undefined function render_navbar_template() /public_html/optout-reminders.php on line 40

TalkVirginia
05-27-2011, 06:56 PM
first Bug, I get the following Error

Fatal error: Class 'vB_Template_Runtime' not found in xxxx/public_html/admincp/inactivitylog.php on line 112

one more bug, when a user want to opt himself out

Fatal error: Call to undefined function render_navbar_template() /public_html/optout-reminders.php on line 40

Bah!! :) I had a feeling like I was forgetting something. Ok. Thanks for letting me know. I'll fix these tonight when I get home.

In the meantime, see if these work. I did a quick patch. ;)

MrAd
05-27-2011, 07:03 PM
Bah!! :) I had a feeling like I was forgetting something. Ok. Thanks for letting me know. I'll fix these tonight when I get home.

Thank you Sir! for this great mod!

MrAd
05-27-2011, 08:22 PM
bot fixes works smooth Jim,

just a quick question, how would you check if a mail is bounced or not, I know some of my members mails are not valid and eventually should return back. But it s still highlighted as green which makes me abit suspicious...

TalkVirginia
05-27-2011, 10:42 PM
bot fixes works smooth Jim,

just a quick question, how would you check if a mail is bounced or not, I know some of my members mails are not valid and eventually should return back. But it s still highlighted as green which makes me abit suspicious...

Disregard the bounce column for now. The bounce detection is not in this version and something I am working on incorporating. I have permission to add functionality that Antivirus used in his product:
EZ Bounced Email Management
https://vborg.vbsupport.ru/showthread.php?t=138884&highlight=bounce+management

and I have permission from tamarian to incorporate similar functionality that was in:
vBouncer: reduce server load by unsubscribing bouncing members from threads
https://vborg.vbsupport.ru/showthread.php?t=83486

microbob
05-28-2011, 10:48 PM
I'd like to install the 2.1.5 version of this hack on my vBulletin 3.8.4 version. Problem is that my web host is telling me that the downloaded files say for vB4 but the page here on vBulletin.org says it's OK for 3.8.x.

Which is it??? :confused:

Bob

TalkVirginia
05-28-2011, 10:55 PM
I'd like to install the 2.1.5 version of this hack on my vBulletin 3.8.4 version. Problem is that my web host is telling me that the downloaded files say for vB4 but the page here on vBulletin.org says it's OK for 3.8.x.

Which is it??? :confused:

Bob

v2.1.5 under the vBulletin 3.8 mods section is fine for v3.8.4. I made a couple quick patches recently that I uploaded to this thread that you will need to drop in since I didn't get a chance to update the zip file. Drop those in and you will be good to go. :) :up:

TalkVirginia
05-28-2011, 11:02 PM
Here are a couple fixes for the queries I missed where missed adding the condition for usergroups so it didn't matter what groups you selected in the mod settings. This was pointed out to me today on the 4.0 version.

Here's where you need to drop these files:

functions_remindermail.php => forumroot/includes folder
process_inactive_members.php => forumroot/includes/cron folder

TalkVirginia
05-28-2011, 11:22 PM
The product zip file is now includes the recent bug fixes.

microbob
05-31-2011, 02:10 PM
Bob here again. So at this point, and based on your response in #19, I now only have to download the zip file as it has been updated with all current fixes? Please confirm. Thanks.

TalkVirginia
06-02-2011, 11:49 AM
Bob here again. So at this point, and based on your response in #19, I now only have to download the zip file as it has been updated with all current fixes? Please confirm. Thanks.

Yes. you should download the zip. It has all the updated files. If you have made any changes to the email templates(phrases) you should back them up before updating otherwise dropping the files in place should be fine.

FIM
06-02-2011, 06:51 PM
thanks man

TalkVirginia
06-02-2011, 07:00 PM
thanks man

Sure thing! Let me know if you have questions.

microbob
06-14-2011, 02:30 PM
Jim,

Installed your hack via vBulletin V3.8.4 PL2. The hack itself is actually located under my vB Options. I put something together (in terms of a message for the inactive members) and saved it. Is that it? Do I have to do anything else?

Something else that I noticed is that there is no new, drop-down menu for the reports which are mentioned in your attachment materials.

Not sure where I'm supposed to get the activity/inactivity reports?

Please help.

Bob

TalkVirginia
06-19-2011, 05:35 PM
Jim,

Installed your hack via vBulletin V3.8.4 PL2. The hack itself is actually located under my vB Options. I put something together (in terms of a message for the inactive members) and saved it. Is that it? Do I have to do anything else?

Something else that I noticed is that there is no new, drop-down menu for the reports which are mentioned in your attachment materials.

Not sure where I'm supposed to get the activity/inactivity reports?

Please help.

Bob

It should work fine for v3.8.4. I've tested it on 3.8.6. Settings screen does appear under Vb Options, however make sure you upload the cpnav_remindermail.xml file to your xml folder under your forum's include folder. (example: <forumroot>\includes\xml ), then refresh your admincp page and it will be right above the users menu on the left as shown in the attachment below. The only feature in the way of reports this mod has is an Inactivity log viewer.

One thing I strongly recommend is that if you have had a previous version of this addon installed (that was written by someone else). You must uninstall it, remove any files that came with the previous addon, then reinstall this addon. If you don't, there is a great chance that any files left from the previous addon will conflict and this addon will not work correctly.

You can find the email templates by going to the addon settings. There is a link there to modify the subject and the email body. Your forum must be in DEBUG mode in order to modify the base version. You can only translate them when in non-debug mode.

Let me know if you have more questions,

Jim

Shaheen
07-12-2011, 02:55 PM
Thanks for the mod

Shaheen
07-12-2011, 03:45 PM
i am getting error when i check inactivity log --- > click on username and on top i get this error
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in [path]/admincp/user.php(545) : eval()'d code on line 29

i dono why any idea?

tandy
07-14-2011, 02:53 AM
I have the same problem at the same place.

tandy
07-14-2011, 09:50 AM
In the inactivity log viewer the userid is 0.

TalkVirginia
07-14-2011, 12:02 PM
Thanks. I'll take a look at this as soon as I can, probably this weekend.

blackberry
07-15-2011, 03:48 PM
it shows userid 0 for all users??

TalkVirginia
07-15-2011, 05:06 PM
it shows userid 0 for all users??

Yes, it's only in the inactivity log. I will fix that tonight.

tandy
07-18-2011, 06:21 AM
Yes, it's only in the inactivity log. I will fix that tonight.

Is it a good idea to wait for a new revision?

waynne
07-19-2011, 05:58 AM
Would it be possible to add a "consider user 'Dead' option at..." So when they haven't logged in for 365 days we stop sending them reminder emails.

Also I have 2 questions.

1) If I install this I presume it will then email all my inactive users, some of these are over 5 years old and inactive and this will certainly get me flagged up as a spammer as there email addresses are probably inactive. Can I exclude users that have not been recently active ie in the last year or two? Is there a MYSQL statement I can run for example to set them to "not receive reminder emails".

2) If I set the reminder emails to 10 - does this mean that the user will only get 10 reminder emails ever or does the counter reset when they become active again?

Ideally I'd like to email a reminder out at 30, 90, 120 and 365 days each time someone goes inactive, can this be done? After this period I don't think the user is coming back to me.

I look forward to the bounce handling option.

microbob
07-21-2011, 07:13 PM
Jim,

I'm s-t-i-l-l trying to get your hack installed on V3.8.5 (although planning on upgrade to 3.8.7 soon for security purposes). Everything is up in the Admin CP with the exception of the drop down menu on the left illustrated here:

https://vborg.vbsupport.ru/attachment.php?attachmentid=130196&d=1308509227

Note: /includes/xml/cpnav_remindermail.xml is as instructed but when I refresh, there is no dropdown menu showing up.

I'm not sure about the sequence of activities (regarding DEBUG MODE) to get this wrapped up and actually working. I have the following questions:


-I have a file sitting in my cPanel public FTP root: optout-reminders.php. Where does this belong?
-When should the the missing menu appear in the AdminCP?
-After I modify the subject and body of the e-mail template?
-Is this [below] the sequence of events to do that?
-Can I get all (3) things done in one shot?

1) Add the following line to config.php located in /includes to enter into DEBUG mode:

$config['Misc']['debug'] = 1;

2) Change the subject and body of the e-mail template to my individualized message

3) Save the Subject and Body

4) Go back into the config.php located in /includes and remove $config['Misc']['debug'] = 1;

5) Click on "Yes" on "Enable Product?":

6) Save

Is that all that's required?confused:

Please help.

Bob

TalkVirginia
07-21-2011, 07:32 PM
Would it be possible to add a "consider user 'Dead' option at..." So when they haven't logged in for 365 days we stop sending them reminder emails.

Also I have 2 questions.

1) If I install this I presume it will then email all my inactive users, some of these are over 5 years old and inactive and this will certainly get me flagged up as a spammer as there email addresses are probably inactive. Can I exclude users that have not been recently active ie in the last year or two? Is there a MYSQL statement I can run for example to set them to "not receive reminder emails".

2) If I set the reminder emails to 10 - does this mean that the user will only get 10 reminder emails ever or does the counter reset when they become active again?

Ideally I'd like to email a reminder out at 30, 90, 120 and 365 days each time someone goes inactive, can this be done? After this period I don't think the user is coming back to me.

I look forward to the bounce handling option.

I am working on resolving these issues.. I've just been limited on time to go around. Some of this I've already resolved in the 4.0 version I just need to add it to the 3.8.x version.

TalkVirginia
07-21-2011, 07:37 PM
Jim,

I'm s-t-i-l-l trying to get your hack installed on V3.8.5 (although planning on upgrade to 3.8.7 soon for security purposes). Everything is up in the Admin CP with the exception of the drop down menu on the left illustrated here:

https://vborg.vbsupport.ru/attachment.php?attachmentid=130196&d=1308509227

Note: /includes/xml/cpnav_remindermail.xml is as instructed but when I refresh, there is no dropdown menu showing up.

I'm not sure about the sequence of activities (regarding DEBUG MODE) to get this wrapped up and actually working. I have the following questions:


-I have a file sitting in my cPanel public FTP root: optout-reminders.php. Where does this belong?
-When should the the missing menu appear in the AdminCP?
-After I modify the subject and body of the e-mail template?
-Is this [below] the sequence of events to do that?
-Can I get all (3) things done in one shot?

1) Add the following line to config.php located in /includes to enter into DEBUG mode:

$config['Misc']['debug'] = 1;

2) Change the subject and body of the e-mail template to my individualized message

3) Save the Subject and Body

4) Go back into the config.php located in /includes and remove $config['Misc']['debug'] = 1;

5) Click on "Yes" on "Enable Product?":

6) Save

Is that all that's required?confused:

Please help.

Bob

Sorry Bob, that sequence of events doesn't apply to the left side menu. It sounds like you may have 2 separate versions competing with each other possibly. Please make sure you don't have an old cpnav_remindermail file by chance. Compare with the one in the zip file. If it's in there it should work.

microbob
07-21-2011, 11:33 PM
Please attach the updated file here so I can download and overwrite the one that in there now.

Also, where does this file go? optout-reminders.php

It's sitting in my FTP folder and I know that's not where it belongs. Maybe that's the cause?

Please advise.
Bob

TalkVirginia
07-21-2011, 11:47 PM
Please attach the updated file here so I can download and overwrite the one that in there now.

Also, where does this file go? optout-reminders.php

It's sitting in my FTP folder and I know that's not where it belongs. Maybe that's the cause?

Please advise.
Bob

I haven't updated anything yet.

The optout-reminders.php file goes in your forum root folder.

microbob
07-22-2011, 12:52 AM
OK Jim...I seem to have gotten everything straightened out with the help of my web host. Got the drop down menu installed after reloading the product install file and moving "optout-reminders.php" as recommended.

Now, I would like to test this out on my board which currently has about 875 registered members and a lot of inactive users. How do I get it to send out the reminder e-mail NOW, and then reset it afterward, so I can see the inactivity log? What settings do I apply to have it send the message out tomorrow [Friday]?

Thanks again.
Bob

adwade
07-22-2011, 03:57 AM
Two brief questions:

You can find the email templates by going to the addon settings. There is a link there to modify the subject and the email body. Your forum must be in DEBUG mode in order to modify the base version. You can only translate them when in non-debug mode.
Jim
1)I don't quite understand this reasoning about revising the subject/body of the email. I've always just used the Copy Default Text button(i.e. Translations Feature) to 're-word' things as needed. Is there any reason, why that would not work with this add-on?(i.e. Why would one use DEBUG mode to revise your original text, when the translate feature is available?)

Is it a good idea to wait for a new revision?
2)With the consequences being so great, is this add-on ready for prime-time use? I don't want to install it and have lots of angry/inactive users, if something can still go amiss right now using the existing code we can D/L at present.(i.e. Is it safe?)

realmr
10-19-2011, 10:34 PM
any updates Jim ?

Artes_Marciales
10-20-2011, 07:43 PM
Amazing, thanks! : D

SamirDarji
12-02-2011, 06:31 AM
Reminder for me to look into this. I can't believe I didn't see it before!

busybeeburns
04-29-2012, 04:19 PM
Hi,

thanks for the mod.

1) Does it work for secondary usergroups or primary only? I have various smaller secondary groups within registered members but doesn't seem to be sending any emails out to those alone.

2) Could this mod essestially be used as a mailout on a cronjob basis, with the phrase template altered each time and inactive time ~0.1?

YankForum
07-31-2012, 04:06 PM
talkvirginia this is super greate , i miss confused other plugins with this one , but of course this is the best one among them , i dont know why it never won MOTH which it deserves to win.

how come there is no author link ? it's totally free ?

tehPARADOX
08-03-2012, 05:28 AM
Doesn't seem as effective anymore.

ennio
09-10-2012, 06:33 PM
It would be nice if it had a feature to send the reminder to an user manually. So, after you search a user on the results page you could select send reminder to user.

waynne
01-14-2013, 11:32 AM
I have a fix and hack for this to be applied to functions_remindermail.php

This fixes the lack of userid in the unsubscribe email link and log files...
Find

$sql = "SELECT username, email, ".
"usergroupid, ".

Replace with
$sql = "SELECT username, email, userid, ".
"usergroupid, ".

The following restricts reminder emails to members who have been active in the last year. This is helpful to reduce the risk of spamming old defunct addresses.

Find (3 instances)
"AND options & 16 ".
"AND rmoptout = 0 ";

Replace with
"AND options & 16 ".
"AND TIMESTAMPDIFF(DAY, FROM_UNIXTIME(lastactivity), FROM_UNIXTIME(UNIX_TIMESTAMP())) <= '365'".
"AND rmoptout = 0 ";

(Caution :- You must add this code in all 3 places or you'll end up repeatedly emailing the same user.)