PDA

View Full Version : Mini Mods - [OzzModz] Email Admin For Expiring Subscriptions


ozzy47
01-07-2015, 10:00 PM
Another mod brought to you by,
https://vborg.vbsupport.ru/external/2015/01/1.png

This mod will allow admins to get emails for their users paid subscriptions that are about to expire. This is a cron job, and it will sent the specified email addresses the email between 2 - 3 days before the subscription expires. This should allow you to perhaps entice the member somehow to renew their subscription. Because they may have not got the mail notifying them that it is about to expire.

The email title, as well as the message that is sent is phrased, so you can translate it to your language.

It is a simple installation upload the contents of the UPLOAD folder, then import the product XML, ozzmodz_sub_expiry

You can edit the options under the settings, [OzzModz] Email Admin For Expiring Subscriptions Settings

Complete Feature List
Option to disable the mod completely.
Option to set which emails to send the email to when a users paid subscription is about to expire.
Frequently Asked Questions.

Q. Why do I need such a thing, you ask?

A. Some admins might like to know before hand that a users paid subscription is going to expire.

Q. Can I send it to multiple email addresses??

A. Yes you can.

-------------------------------------------------------------------------------------------

If you like this mod please hit the https://vborg.vbsupport.ru/external/2015/08/1.png button to the right ---->

Please remember to click the, https://vborg.vbsupport.ru/external/2015/08/2.png button to the right if you installed the mod ---->

What does 'Marking As Installed' do ?

* It helps you to stay on top of updates - members who have installed modifications will be notified whenever new updates are available.

* For security issues - vbulletin.org will contact all members who have installed a modification whenever a security issue is brought to their attention.

* Marking a modification as installed also helps me know how many people are using my work, giving me extra incentive to provide more features and new modifications.

I appreciate the support!
-------------------------------------------------------------------------------------------

* History (Changelog) *
-------------------------
v1.0.0 (January 8, 2015)
- Initial public release.

ozzy47
01-08-2015, 09:00 PM
Reserved.

Johnny G
01-08-2015, 09:05 PM
Excellent mod, installed. Great idea.

ozzy47
01-08-2015, 09:05 PM
Glad you like it and thanks for marking as installed. :)

CharlieDelta
01-08-2015, 10:34 PM
This will be a handy mod. I am always looking at my subs to see if some have expired and most of the time I am too late and they have.

Will install this shortly.

ozzy47
01-08-2015, 10:52 PM
Excellent, don't forget to mark as installed when you do.

TheLastSuperman
01-08-2015, 11:08 PM
*Idea

If possible, have option to allow admin to specify receiving email of subscriptions not renewed after X days of expiring - this way they know who has not renewed by said set # of days since subscription is marked as expired. Edit: This will allow the admin to reach out to them and see why they didn't renew and possibly work something out or give them a discount to regain their subscription.

ozzy47
01-08-2015, 11:17 PM
Yeah that is something I can look into at some point. :)

CharlieDelta
01-08-2015, 11:26 PM
Excellent, don't forget to mark as installed when you do.

Never missed one yet. :)
Done.

ozzy47
01-08-2015, 11:28 PM
Good deal, hope ya like it, and thanks for marking as installed. :)

ozzy47
01-08-2015, 11:31 PM
*Idea

If possible, have option to allow admin to specify receiving email of subscriptions not renewed after X days of expiring - this way they know who has not renewed by said set # of days since subscription is marked as expired. Edit: This will allow the admin to reach out to them and see why they didn't renew and possibly work something out or give them a discount to regain their subscription.

Actually now that I think about it, is the subscription information retained in the subscriptionlog table after it expires? I don't use them, so I do not know for sure.

TheLastSuperman
01-09-2015, 12:53 AM
Isn't that what status in that table is used for?

Edit: Why does that seem like grammar in a half shell ^ :p

AND status = 1

ozzy47
01-09-2015, 12:57 AM
This is the lines of code that runs on the cron.

if (is_array($subobj->subscriptioncache))
{
foreach ($subobj->subscriptioncache as $key => $subscription)
{
// disable people :)
$subscribers = $vbulletin->db->query_read("
SELECT userid
FROM " . TABLE_PREFIX . "subscriptionlog
WHERE subscriptionid = $subscription[subscriptionid]
AND expirydate <= " . TIMENOW . "
AND status = 1
");

while ($subscriber = $vbulletin->db->fetch_array($subscribers))
{
$subobj->delete_user_subscription($subscription['subscriptionid'], $subscriber['userid'], -1, true);
}
}

So if I read that right, it deletes the subscription.

TheLastSuperman
01-09-2015, 01:00 AM
I read the same... so then perhaps add a field to your mod, when it emails them it adds their userid and subscription type then query said table every 10 days or so via cron, if their userid is present it emails admin or something like that still just spitting out ideas. One way to work around the deletion of subs and also retain prior sub info in a sense but like I said twas just an idea up to you IF you want to go through the trouble.

ozzy47
01-09-2015, 01:03 AM
Perhaps, if their is enough interest. but it seems like a lot of trouble to go through. IMO the records should not be deleted anyway, they should stay in the DB untill I of course want to thin out the table, then I should be able to run a cron, to delete subscriptions older than X.

To bad they did not think of it when they built the system.

CharlieDelta
01-09-2015, 02:05 AM
I like the idea proposed by Superman. :up:

ozzy47
01-09-2015, 10:07 AM
Cool, that's two. :)

Fields
01-09-2015, 10:17 AM
Damn, can you read my mind? :D I've been waiting for months for this, thank you very much ozzy :)

ozzy47
01-09-2015, 10:19 AM
I know something like this has been asked for quite a few times over the years, so I figured why not. :p

Thanks for marking as installed. :)

ozzy47
01-09-2015, 11:12 AM
I read the same... so then perhaps add a field to your mod, when it emails them it adds their userid and subscription type then query said table every 10 days or so via cron, if their userid is present it emails admin or something like that still just spitting out ideas. One way to work around the deletion of subs and also retain prior sub info in a sense but like I said twas just an idea up to you IF you want to go through the trouble.

I just made a subscription expire, and it seems to just update the DB and set status to 0

So could someone that actually runs paid subscriptions check their DB and see if it holds all the expired ones?

TheLastSuperman
01-09-2015, 11:26 AM
I just made a subscription expire, and it seems to just update the DB and set status to 0

So could someone that actually runs paid subscriptions check their DB and see if it holds all the expired ones?

One would assume but you know what they say about that, issue for me yesterday was localhost w/o any subscriptions and I don't just login to clients sites to test things blindly out of curiosity so with that being said I'll setup a paid subscription on localhost later and fiddle with it if I have time just depends on how much coffee's left in my bucket and whether or not I must go pickup coffeemate creamer or not - rough morning's w/o my coffee now deary lol.

Edit: If it deletes their actual sub though... then would not all members (even if they had subbed or not) who did not have an active sub show as expired? If we think of it that way then yes so then w/o something added to track it you might be sending an email or contacting a member who never had a sub to begin with, only because their "status" is set to 0.

dknelson
01-09-2015, 11:33 AM
FANTASTIC. Thank you so very much. Installed. I use paid subscriptions and have for several years. I will do some checking on the database for you but the way mine work is that the user is put in a different user group automatically when their subscription expires so they are not completely removed from the site. They just lose privileges. All their profile information and etc. is still there. If they renew later, everything is restored.

CharlieDelta
01-09-2015, 02:13 PM
I have lots of paid subs and will have a peek in the db to see what is there.
I have my subs set up as "Recurring" so not sure if this will make a difference as well.
Will post what I find.

CharlieDelta
01-09-2015, 02:41 PM
Looking at my DB and it has stored all expired subs.

ozzy47
01-09-2015, 10:15 PM
Cool, I can then try and work out the query for subs that have expired. Would seven days be a good point?

dknelson
01-09-2015, 11:53 PM
7 days works for me.

Charis
01-13-2015, 04:07 PM
What to say? Thanks, again.
Haven't been bored from so many "thank you"?

CharlieDelta
01-13-2015, 04:50 PM
What to say? Thanks, again.
Haven't been bored from so many "thank you"?

Uhhh, what?

ozzy47
01-13-2015, 10:41 PM
What to say? Thanks, again.
Haven't been bored from so many "thank you"?

Glad you like it, and thanks for marking as installed. :)