| Server IP : 103.234.187.230 / Your IP : 216.73.216.216 Web Server : Apache System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/b2bzend/cronjob/ |
Upload File : |
<?php
require_once 'init.php';
$baseUrl = 'https://globaltravelexchange.com/';
$leadstageObj = new Travel_Model_TblLeadStage();
function writeLog($data) {
$fileName = "Facebook_" . date("Y-m-d") . ".txt";
$fp = fopen("log/" . $fileName, 'a+');
$data = date("Y-m-d H:i:s") . " - " . $data;
fwrite($fp, $data);
fclose($fp);
}
function mailSentByElastice($emailData, $arrEmailStatistics = array()) {
$url = 'https://api.elasticemail.com/v2/email/send';
$to = implode(";", $emailData['to']);
try {
$post = array(
'from' => $emailData['fromEmail'],
'fromName' => $emailData['fromName'],
'apikey' => isset($arrEmailStatistics['EmailKey']) && $arrEmailStatistics['EmailKey'] != '' ? $arrEmailStatistics['EmailKey'] : '51453e3e-df95-4695-970c-68432e4d8785',
'subject' => $emailData['subject'],
'to' => $to,
'bodyHtml' => $emailData['bodyHtml'],
'bodyText' => $emailData['bodyText'],
'isTransactional' => false
);
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => $url,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $post,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER => false,
CURLOPT_SSL_VERIFYPEER => false
));
$result = curl_exec($ch);
curl_close($ch);
} catch (Exception $ex) {
$result = $ex->getMessage();
}
}
$CurrentDateTime = date('Y-m-d');
$datetime = new DateTime($CurrentDateTime);
$datetime->modify('+1 DAY');
$RandomCodeValidTo = $datetime->format('Y-m-d');
$resultSet = $leadstageObj->getEmailPayment($RandomCodeValidTo);
/* echo "<pre>";
print_r($resultSet);
exit; */
foreach ($resultSet as $formKey => $resultSet) {
$fullName = ucfirst(trim($resultSet['FirstName'])) . ' ' . ucfirst(trim($resultSet['LastName']));
$AfullName = ucfirst(trim($resultSet['AFirstName'])) . ' ' . ucfirst(trim($resultSet['ALastName']));
$AgentNo = trim($resultSet['ContactNo1']);
$emailId = trim($resultSet['EmailId']);
$AgentEmailId = isset($resultSet['AgentEmailId']) ? trim($resultSet['AgentEmailId']) : '';
$EmiDate = $resultSet['EmiDate']->format('d-M-y');
$fromName = trim($resultSet['AgencyName']);
$fromEmail = trim($resultSet['PrimaryEmail']);
$destination = trim($resultSet['DestinationPlaces']);
$EmailKey = trim($resultSet['EmailKey']);
$AgencySysId = trim($resultSet['AgencySysId']);
$Amount = round($resultSet['Amount']);
$TPSysId = base64_encode($resultSet['TPSysId']);
$Signature = $resultSet['Signature'];
$PaymentDetails = $resultSet['PaymentDetails'];
$secureCode = Zend_Controller_Action_HelperBroker::getStaticHelper('SecureCode')->secureCode($TPSysId, 1);
$proposalUrl = $baseUrl . 'publicpackage/view-customer-final-package/code/' . $secureCode . '/id/' . $TPSysId;
$BookingUrl = $baseUrl . 'package-booking/package-booking-view/pid/' . $TPSysId . '/ptype/f/code/'.$secureCode;
if ($resultSet['IsB2CSite'] == 1) {
$BookingUrl = $resultSet['Url'] . "detail/index/view/id/" . base64_encode($BookingUrl);
$proposalUrl = $resultSet['Url'] . "detail/index/view/id/" . base64_encode($proposalUrl);
} else if (($resultSet['IsB2CSite'] == 2) && ($resultSet['IsSiteType'] == 1)) {
$BookingUrl = $resultSet['Url'] . "hellogtx/index.html?id=" . base64_encode($BookingUrl);
$proposalUrl = $resultSet['Url'] . "hellogtx/index.html?id=" . base64_encode($proposalUrl);
} else if (($resultSet['IsB2CSite'] == 2) && ($resultSet['IsSiteType'] == 0)) {
$BookingUrl = $resultSet['Url'] . "hellogtx/gtx.php?id=" . base64_encode($BookingUrl);
$proposalUrl = $resultSet['Url'] . "hellogtx/gtx.php?id=" . base64_encode($proposalUrl);
}
$subject = 'Payment Reminder - ' . $fromName;
$adminBodyText = '<table width="800" border="0" cellspacing="0" cellpadding="0" align="center" style="font-family:Arial, Helvetica, sans-serif; font-size:12px; line-height:18px;">
<tr>
<td style="font-size:14px; color:#222; padding:0 0 10px 0; font-weight:bold; font-family:Arial, Helvetica, sans-serif;">Dear ' . $fullName . ' , </td>
</tr>
<tr>
<td style="font-size:14px; color:#222; padding:0 0 10px 0; font-weight:normal; font-family:Arial, Helvetica, sans-serif;">
<strong>Greetings from ' . $fromName . '!</strong> </td>
</tr>
<tr>
<td style="line-height:24px; font-size:13px; color:#222; font-weight: normal; font-family:Arial, Helvetica, sans-serif;"">
Your next payment for your ' . $destination . ' trip is due on ' . $EmiDate . ' for INR ' . $Amount . '. If you want you can view your proposal <a href="' . $proposalUrl . '">here</a>.</td>
</tr>
<tr><td> </td></tr>
<tr>
<td style=" line-height:24px; font-size:13px; color:#222; font-weight: bold; font-family:Arial, Helvetica, sans-serif;"">
You may make the payment by one of the following means:</td>
</tr>
<tr><td> </td></tr>
<tr>
<td style=" line-height:24px; font-size:13px; color:#222; font-weight: normal; font-family:Arial, Helvetica, sans-serif;"">
To make online payment - <a href="' . $BookingUrl . '">CLICK HERE</a>
</td>
</tr>
<tr><td> </td></tr>
<tr>
<td style=" line-height:24px; font-size:13px; color:#222; font-weight: bold; font-family:Arial, Helvetica, sans-serif;"">
To make RTGS/ Bank Transfer Please use the below bank details:
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td style=" line-height:24px; font-size:13px; color:#222; font-weight: normal; font-family:Arial, Helvetica, sans-serif;"">
' . $PaymentDetails . '
</td>
</tr>
<tr><td> </td></tr>
<tr>
<td style=" line-height:24px; font-size:13px; color:#222; font-weight: normal; font-family:Arial, Helvetica, sans-serif;"">
It would be greatly appreciated if you could confirm once the payment is made.</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td style=" line-height:24px; font-size:13px; color:#222; font-weight: normal; font-family:Arial, Helvetica, sans-serif;"">
In case of any query please feel free to contact your trip advisor or call us on below details.</td>
</tr>
<tr>
<td>
<tr>
<td> </td>
</tr>
<tr>
<td style="font-size:13px; color:#222;">Your personal trip manager,<br><br>
' . $AfullName . '<br>
' . $AgentNo . '<br>
' . $Signature . '
</td>
</tr>
<tr>
<td> </td>
</tr>
</td>
</tr>
</table>';
/* echo $adminBodyText;
exit; */
//$agencyPrimaryEmail = "prashant@catpl.co.in";
$agencyPrimaryEmail = $AgentEmailId;
$emailMasterData = array('fromEmail' => $fromEmail, 'fromName' => $fromName, 'subject' => $subject, 'to' => array($emailId, $agencyPrimaryEmail), 'bodyHtml' => $adminBodyText, 'bodyText' => '');
$arrEmailStatisticsType = array_keys(unserialize(ARR_EMAIL_STATISTICS_TYPE));
$arrEmailStatistics = array(
"TPSysId" => 0,
"TypeSysId" => 1, // 1 For Email 2 For SMS
"AgencySysId" => $AgencySysId,
"AgentSysId" => 0,
"Title" => '',
"EmailKey" => $EmailKey,
"Source" => $arrEmailStatisticsType[2], // 6 For Misc
"Status" => 0,
"RefSysId" => "",
"RefSysStatus" => "",
"CreateDate" => date('Y-m-d H:i:s')
);
$checkStatusEmail = mailSentByElastice($emailMasterData, $arrEmailStatistics);
}