10 include_once
'./Services/Mail/classes/class.ilMailNotification.php';
11 include_once
'Services/Mail/classes/class.ilMimeMail.php';
26 foreach ($customer_array as $user_id=>$objects_array)
39 $this->
appendBody($user_lang->txt(
'bought_objects_expire_soon'));
42 foreach($objects_array as $key=>$pobject)
44 $this->
appendBody(
"----------------------------------------------------------------------------------------------");
46 $this->
appendBody($user_lang->txt(
'title').
": ".$objects_array[$key][
'object_title'].
"\n");
47 $this->
appendBody($user_lang->txt(
'access_enddate') .
": ".$objects_array[$key][
'access_enddate']);
53 $this->
appendBody(
"----------------------------------------------------------------------------------------------");
64 $mmail->autoCheck(
false);
65 $mmail->From(
'noreply');
78 $num_days = $ilSetting->get(
'payment_notification_days');
79 $reminder_date = date(
"Y-m-d H:i:s", time() + ($num_days * 24 * 60 * 60));
81 $res = $ilDB->queryF(
'
82 SELECT ps.pobject_id, ps.customer_id, ps.object_title, ps.access_enddate, po.ref_id, po.subtype
83 FROM payment_statistic ps
84 INNER JOIN payment_objects po ON po.pobject_id = ps.pobject_id
85 LEFT JOIN payment_prices pp ON pp.pobject_id = ps.pobject_id
86 WHERE ps.duration > %s
87 AND ps.access_enddate = %s
90 ORDER BY ps.customer_id ASC',
91 array(
'integer',
'date',
'integer',
'integer'),
92 array(0, $reminder_date, 0 , 1));
97 while(
$row = $ilDB->fetchAssoc(
$res))
99 if($customer_id == NULL)
101 $customer_id =
$row[
'customer_id'];
103 else if ($customer_id !=
$row[
'customer_id'])
106 $customer_id =
$row[
'customer_id'];
109 $objects[$customer_id][$counter][
'ref_id'] =
$row[
'ref_id'];
110 $objects[$customer_id][$counter][
'pobject_id'] =
$row[
'pobject_id'];
111 $objects[$customer_id][$counter][
'customer_id'] =
$row[
'customer_id'];
112 $objects[$customer_id][$counter][
'access_enddate'] =
$row[
'access_enddate'];
113 $objects[$customer_id][$counter][
'object_title'] =
$row[
'object_title'];
114 $objects[$customer_id][$counter][
'subtype'] =
$row[
'subtype'];