Notification : ps

This commit is contained in:
VE10-Sanjeev 2024-01-25 14:27:57 +05:30
parent b2590bec9d
commit f802377fe9
2 changed files with 8 additions and 3 deletions

View File

@ -642,14 +642,16 @@ class Notifications extends BaseController
{
$this->logger->info("No Auto Scheduled Notification in DB,exiting...!");
$this->logger->info("Auto Scheduled Notification Ends");
echo "No Scheduled Data Founded"."<br>";
exit();
}
// echo "Notification campaign Result Array in count = ".count($notification_campaign_result)."<br>";
//looping multiple notification campaign
if(count($notification_campaign_result))
{
foreach($notification_campaign_result as $index => $single_campaign)
{
echo "Notification Campaign Name = ".$single_campaign['campaign_name']."<br>";
#step 2 get template details
$template = $this->getTemplateDetails($single_campaign['template_id']);
$this->logger->info("Auto Scheduled Template Details TID = ".$single_campaign['template_id']);
@ -707,6 +709,7 @@ class Notifications extends BaseController
$params->number = (int)'91' . $customer['mobile_no'];
$whatsapp_reponse = $notification->sendWhatsAppMessage($url, "POST", $params);
$whatsapp_reponse_msg = strtolower(gettype($whatsapp_reponse)) == "string" ? $whatsapp_reponse : json_encode($whatsapp_reponse['reponse']);
// echo "Whatsapp Response = ".$whatsapp_reponse_msg."<br>";
$this->logger->info("Auto Scheduled Whatsapp CID = ".$customer['customer_id']." ".$whatsapp_reponse_msg);
$history_child_where = ['fkid' => $single_campaign['history_parent_id'],'id' => (int)$history_child_id];
@ -724,10 +727,12 @@ class Notifications extends BaseController
#step 6 update campaign status to 1
$statement = $model->update_notification_campaign_status(['status' => 1],$single_campaign['campaign_id']);
echo "Final Campaign Status = ".$statement."<br>";
$this->logger->info($statement);
#step 7 update history parent status to 1
$history_parent_statement = $model->update_notification_history_parent_status(['status' => 1],$single_campaign['history_parent_id'],$single_campaign['campaign_id']);
echo "Final Acknowlegdement = ".$history_parent_statement."<br>";
$this->logger->info($history_parent_statement);
}

View File

@ -11,7 +11,7 @@
<th hidden></th>
<th>Name</th>
<th>Mode</th>
<th>Schedule At (Date)</th>
<th>Start At</th>
<th>Sent At</th>
<th>Campaign Name</th>
<th>Status</th>
@ -35,7 +35,7 @@
<td hidden><?= $na['child_id']; ?></td>
<td><?= $customer; ?></td>
<td><?= $na['receiving_entity']; ?></td>
<td><?= $na['formatted_start_date']; ?></td>
<td><?= $na['formatted_start_date_time']; ?></td>
<td><?= $na['formatted_sent_date_time']; ?></td>
<td><?= $campaign; ?></td>
<td><div class="<?= $class; ?>" title="<?= $result; ?>" style="font-size: 1.4rem !important"><?= $icon; ?></div></td>