| Server IP : 172.67.201.108 / Your IP : 216.73.216.11 Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5 System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/mitzvahm/wwwdevplanner/mod/ |
Upload File : |
<?php include('_mod_security.php'); ?>
<?php
if ($_GET['auth_key'] != $app_cron_auth_key) :
error_reporting(0);
die('Not Authorized!');
endif;
$days = nz(mysqli_real_escape_string($GLOBALS['con'], trim($_GET['days'])),'5');
$sql = "SELECT p.first_name, p.last_name, p.email, p.coupon_code, p.coupon_discount FROM prospects p INNER JOIN promo_codes pc ON (p.coupon_code = pc.code AND pc.expires >= CURDATE()) LEFT OUTER JOIN users u ON (p.email = u.email) ".
"WHERE DATE(p.signup_date) = DATE_SUB(CURDATE(), INTERVAL ".$days." DAY) AND u.email IS NULL";
//echo $sql;
$result = mysqli_query($GLOBALS['con'], $sql) or die('Database Error!');
//$result = mysqli_query($GLOBALS['con'], $sql) or die(mysqli_error($GLOBALS['con']));
//echo mysqli_num_rows($result);
write_log('I',0,'Automatic coupon reminder emails processed. Emails selected: '.mysqli_num_rows($result));
while ($row = mysqli_fetch_object($result)) :
//echo $row->first_name.' '.$row->last_name.' '.$row->signup_date.' '.$row->email.'<br />';
//***************** mail using PEAR *****************
require_once "Mail.php";
$mail_body = '<html>'.
'<style>body {font-family:Arial, Helvetica, sans-serif; font-size:14px;} table {font-size:14px;}</style>'.
'Dear '.$row->first_name.' '.$row->last_name.', <br><br>'.
'Thank you for your interest in <a href="'.$app_base_secure.'index.php?IX=signup_form&first_name='.urlencode($row->first_name).'&last_name='.urlencode($row->last_name).'&email='.urlencode($row->email).'&promo_code='.urlencode($row->coupon_code).'">MitzvahOrganizer.com</a>.<br /><br />'.
'We wanted to remind you about the following promotion code which will give you '.$row->coupon_discount.' off the regular purchase price: '.
'<strong>'.$row->coupon_code.'</strong><br><br>'.
'When you use the Mitzvah Organizer software, you can keep track of all the details involved in planning your child\'s celebration. We know parents are thinking about their event all the time and many Mitzvah Organizer users tell us they love that they have access to their guest lists, budgets, songs for the DJ, favor sizes, Temple honors, seating arrangements, candle lighting and more 24/7. Everything is stored in the cloud and available on a laptop, tablet and phone.'.
'<br><br>'.
'So visit <a href="'.$app_base_secure.'index.php?IX=signup_form&first_name='.urlencode($row->first_name).'&last_name='.urlencode($row->last_name).'&email='.urlencode($row->email).'&promo_code='.urlencode($row->coupon_code).'">www.MitzvahOrganizer.com</a> today and use promotion code Celebrate2 and let\'s get your planning started.'.
'<br><br>'.
'Thank you and we look forward to helping you plan your child\'s Bar Bat Mitzvah celebration.'.
'<br><br>'.
'Please don\'t hesitate to contact us if you have questions or encounter any issues. <br><br>'.
'Thank You, <br>'.
'The MitzvahOrganizer Team <br>'.
'<a href="'.$app_base.'">'.$app_base.'</a> <br>'.
'<a href="mailto:[email protected]">[email protected]</a> <br>'.
'</html>' ;
$pmail_from = '[email protected]';
$pmail_to["To"] = $row->email;
$pmail_to["Bcc"] = $app_mail_bcc;
$pmail_subject = 'Mitzvah Organizer Discount Code';
$pmail_body = $mail_body;
$pmail_host = get_cfg_var('SMTP');
$pmail_username = "";
$pmail_password = "";
$pmail_headers = array ('From' => $pmail_from,
'To' => $pmail_to["To"],
'Subject' => $pmail_subject,
'MIME-Version' => '1.0',
'Content-type' => 'text/html; charset=iso-8859-1');
$smtp = Mail::factory('smtp',
array ('host' => $pmail_host,
//'auth' => true,
'auth' => false,
'username' => $pmail_username,
'password' => $pmail_password
));
$pmail = $smtp->send($pmail_to, $pmail_headers, $pmail_body);
endwhile;
?>