View Full Version : whmcs trial 30 days, then bill sent?
gaogier
02-16-10, 09:44 PM
Hello
Is there an addon for this, not sure the addon i downloaded would work.
I need a whmcs 90 day trial.
The plan.
Users join, use our promotion key and get 90 days worth of hosting free.
This would be a trial hosting account, they can leave before its up. If they don't I want them to have a bill sent to them.
Is there something like this already around?
A free trial mod is available at http://whmcs.com/members/communityaddons.php however the official addon will simply terminate the account after the trial period.
gaogier
02-19-10, 11:59 AM
So, there is not one possible?
I was looking for the same thing, but instead of terminating the account charge the customer's credit card. Is it very complicated to modify the current addon to do this?
thunderesl
02-26-10, 10:14 AM
Hi guys,
I want to use the Official Free Trials mod but instead of terminating the trial account after it expires i would like to suspend the account. Then if the customer just forgets to upgrade i still have their account on the server if they come bak so i can just unsuspend them and save time.
I think it should be fairly simple to change the command from terminate to suspend in the action hooks code but im not a coder and dont really have the first idea where to look to do this. Could someone please tell me how to do this.
Thanks in advance
If the upgrade reminder email is sent once the account trial has finished, the account is terminated so I find the official trials mod, as it is right now, a little bit useless.
It would be nice to send an email X days prior the end of the trial so that the client has enough time to decide either they want to pay for the account or leave.
Just in case someone is interested, I've modified the original code to send the email X days after the signup, and Y days after the signup to terminate the account (IMHO, just the way it should work).
If anyone wants to test it, here it is:
<?php
function end_free_trials_hook($args) {
if (!function_exists("ModuleBuildParams")) require(ROOTDIR."/includes/modulefunctions.php");
# Duplicate the free trials array for each trial product you want to offer entering the
# product id, how many days to allow and email template to send when the trial period ends
$freetrials[] = array(
"pid" => "1",
"days" => "15",
"days_email" => "10",
"email_subject" => "Aviso Hosting Prueba",
);
# Do not edit below this line
foreach ($freetrials AS $data) {
$pid = $data["pid"];
$days = $data["days"];
$email_subject = $data["email_subject"];
$trialexpiry = date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$days,date("Y")));
$emailexpiry = date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$days_email,date("Y")));
$query = "SELECT tblhosting.id,tblproducts.servertype FROM tblhosting INNER JOIN tblproducts ON tblproducts.id=tblhosting.packageid WHERE packageid=".(int)$pid." AND domainstatus='Active' AND regdate<'$emailexpiry'";
$result = full_query($query);
while($data = mysql_fetch_array($result)) {
$id = $data["id"];
$module = $data["servertype"];
if (!function_exists($module."_ConfigOptions")) require_once(ROOTDIR."/modules/servers/$module/$module.php");
sendMessage($email_subject,$id);
}
$query = "SELECT tblhosting.id,tblproducts.servertype FROM tblhosting INNER JOIN tblproducts ON tblproducts.id=tblhosting.packageid WHERE packageid=".(int)$pid." AND domainstatus='Active' AND regdate<'$trialexpiry'";
$result = full_query($query);
while($data = mysql_fetch_array($result)) {
$id = $data["id"];
$module = $data["servertype"];
if (!function_exists($module."_ConfigOptions")) require_once(ROOTDIR."/modules/servers/$module/$module.php");
ServerTerminateAccount($id);
}
}
}
add_hook("DailyCronJob",1,"end_free_trials_hook","");
?>
thunderesl
03-03-10, 08:31 AM
Is there anyway to make it Suspend the account instead of terminating it?
jcorbett
03-04-10, 01:33 PM
This would really be helpful. I did a vanilla install and it terminated certain accounts I had setup for free. Thank G-d the cron job ran only after I had my nightly backups.
ExsysHost
03-04-10, 09:35 PM
I created a complete free trials mod that handles multiple notices as well as suspension before termination in order to give the customer more time to realize their free trial was over before we deleted their files from the server.
http://forum.whmcs.com/showthread.php?p=142436
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.