Jump to content

Automatically email client after X amount of days


Daniel

Recommended Posts

I had this created a while ago and have not been using it recently, however it should work fine with the latest version.

 

This is a simple php script that runs on a daily cron to email clients 45 days after signup. This can be used to ask for feedback or to upsell a product.

 

Download Link

Link to comment
Share on other sites

The email template can be absolutely anything you like, we've not used this since around WHMCS 3.4 and no longer have the template that we used.

 

I'm sure it said something along the lines of "We're happy to tell you you've been with XYZHosting for 45 days now and thought we'd send a quick email to check you're happy with the service blah blah blah.."

 

I'm sure you can come up with something :)

Link to comment
Share on other sites

I think using the API would be a lot easier, this API function probably wasn't around when the script above was written but using the API is probably the better way :)

 

function send_notice($message_name,$client_id) {

$url = "http://www.yourdomain.com/whmcs/includes/api.php"; # URL to WHMCS API file
$username = "Admin"; # Admin username goes here
$password = "demo"; # Admin password goes here

$postfields["username"] = $username;
$postfields["password"] = md5($password);
$postfields["action"] = "sendemail";
$postfields["messagename"] = $message_name;
$postfields["id"] = $client_id;

	$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$data = curl_exec($ch);
curl_close($ch);

$data = explode(";",$data);
foreach ($data AS $temp) {
		 $temp = explode("=",$temp);
 		$results[$temp[0]] = $temp[1];
	}

if ($results["result"]=="success") {
	 # Result was OK!
	} else {
# An error occured
 echo "The following error occured: ".$results["message"];
}

}

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
  • 1 month later...
  • 9 years later...
23 minutes ago, DraGoNeTi said:

reupload and update it for v7, please

the addon would be irrelevant now - you can do the same thing using the built in Email Marketer...

Quote

The email marketer tool allows you to schedule automated emails to be sent out to your clients when certain events and/or criteria are met.

https://blog.whmcs.com/?t=67270

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated