Hello,
I am new here, and in need of some help.
For a client of ours I've made a website in Wordpress where users can register and add properties (paid). They can choose packages for a month or a year and make a payment. The theme that I am using has an automated mail function that reminds the user that their object is about to expire. This email is sent 1 day before expire, which is a bit short. The theme developer says this is standard and cannot be changed, so I have been digging in the files and came accross the code that does this, I just have no idea how to change it to make it send 10 days before, this is a part of the code and I assume this is handling the day function and the part that needs to be changed:
/
*Start: Check expiring items and send email 1 day before.
/
add_action( 'schedule_hooks_daily', 'check_expiring' );
function check_expiring() {
/*
Only for Direct payments. And this schedule will check item 1 day before expire.
*/
$setup33_emaillimits_listingautowarning = PFMSIssetControl('setup33_emaillimits_listingautowarning','','1');
if ($setup33_emaillimits_listingautowarning == 1) {
$exptime = strtotime(date("Y-m-d H:s:i", strtotime("-1 day")));
$exptime = date('Y-m-d H:s:i',mktime(23,59,59,date('m',$exptime),date('d',$exptime),date('Y',$exptime)) );
$exptime2 = strtotime(date("Y-m-d H:s:i", strtotime("+1 day")));
$exptime2 = date('Y-m-d H:s:i',mktime(23,59,59,date('m',$exptime2),date('d',$exptime2),date('Y',$exptime2)) );
global $wpdb;
$results = $wpdb->get_results( $wpdb->prepare(
"SELECT p.ID, p.post_author, pm.meta_value, p.post_date FROM $wpdb->posts as p
INNER JOIN $wpdb->postmeta as pm
ON ( p.ID = pm.post_id )
INNER JOIN $wpdb->postmeta as pm2
ON ( pm.post_id = pm2.post_id )
WHERE p.post_type = %s
and p.post_status = %s
and p.post_parent = %d
and pm.meta_key = %s
and pm.meta_value >= %s
and pm.meta_value <= %s
and pm2.meta_key = %s
and pm2.meta_value = 0",
"orders",
"completed",
0,
"order_expiredate",
$exptime,
$exptime2,
"order_recurring"
)
,'OBJECT_K' );
Could somebody here help me out?
Thanks
Marieke