Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Thanks for your reply Ruth.
I took a slightly different approach (not expecting such a quick response!)
I wrote an external script that grabs everyone who's subs are expiring in 10 days, then again in 5 days. If they haven't re-upped - the expiration email gets sent from cbsubs.
I've removed the identifying info for privacy for my client...
[code:1]<?php
include ("data_connect.php"«»); // grabs the database info
$today=date('Y-m-d');
$ten = strtotime($today) + 240*3600;
$five = strtotime($today) + 120*3600;
$expire= date('Y-m-d', $ten);
$expire2= date('Y-m-d', $five);
$q="SELECT joscbsubs_subscriptions.status, joscbsubs_subscriptions.user_id, joscbsubs_subscriptions.plan_id, joscbsubs_subscriptions.expiry_date, joscomprofiler.firstname, joscomprofiler.lastname, josusers.email
FROM joscbsubs_subscriptions, josusers, joscomprofiler
WHERE joscbsubs_subscriptions.user_id = josusers.id
AND joscbsubs_subscriptions.status = 'A'
AND joscbsubs_subscriptions.expiry_date > '$expire 00:00:00'
AND joscbsubs_subscriptions.expiry_date < '$expire 23:59:59'
AND joscbsubs_subscriptions.user_id = josusers.id
AND joscomprofiler.user_id = josusers.id";
$r=mysql_query($q);
while ($rr=mysql_fetch_array($r)) {
$day=$rr[expiry_date];
$ex_date=date('l, F j, Y',strtotime($day));
$message="Dear $rr[firstname],
rest of the message here";
$subject="subject";
$recipient = $rr[email];
$body = "<html>\n";
$body .= "<body style=\"font-family:Verdana, Verdana, Geneva, sans-serif; font-size:12px; color:#000;\">\n";
$body = $message;
$body .= "</body>\n";
$body .= "</html>\n";
$headers = "From: my company <info@mycompany.com>\r\n";
$headers .= "Reply-To: info@mycompany.com\r\n";
$headers .= "Return-Path: info@mycompany.com\r\n";
$headers .= 'MIME-Version: 1.0' . "\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
return mail($recipient, $subject, $message, $headers);
}
// 5 days
$q="SELECT joscbsubs_subscriptions.status, joscbsubs_subscriptions.user_id, joscbsubs_subscriptions.plan_id, joscbsubs_subscriptions.expiry_date, joscomprofiler.firstname, joscomprofiler.lastname, josusers.email
FROM joscbsubs_subscriptions, josusers, joscomprofiler
WHERE joscbsubs_subscriptions.user_id = josusers.id
AND joscbsubs_subscriptions.status = 'A'
AND joscbsubs_subscriptions.expiry_date > '$expire2 00:00:00'
AND joscbsubs_subscriptions.expiry_date < '$expire2 23:59:59'
AND joscbsubs_subscriptions.user_id = josusers.id
AND joscomprofiler.user_id = josusers.id";
$r=mysql_query($q);
while ($rr=mysql_fetch_array($r)) {
$day=$rr[expiry_date];
$ex_date=date('l, F j, Y',strtotime($day));
$message="Dear $rr[firstname],
rest of message";
$subject="Your subscription is about to expire.";
$recipient = $rr[email];
$body = "<html>\n";
$body .= "<body style=\"font-family:Verdana, Verdana, Geneva, sans-serif; font-size:12px; color:#000;\">\n";
$body = $message;
$body .= "</body>\n";
$body .= "</html>\n";
$headers = "From: my company <info@mycompany.com>\r\n";
$headers .= "Reply-To: info@mycompany.com\r\n";
$headers .= "Return-Path: info@mycompany.com\r\n";
$headers .= 'MIME-Version: 1.0' . "\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
return mail($recipient, $subject, $message, $headers);
}
?>[/code:1]
Its a quick fix...not pretty - but its automated and works
thanks again for your input... I'll see about integrating the two!
Please Log in to join the conversation.
Please Log in to join the conversation.