FIX_BUG id - 0001097
This commit is contained in:
parent
774d3733c3
commit
6794e9d2f3
@ -19,6 +19,7 @@ class Notifications extends BaseController
|
||||
if($records['mode'] == 'Email'){
|
||||
helper('notification');
|
||||
$notification = new NotificationHelper();
|
||||
$records['description'] = $records['maildescription'];
|
||||
$data = $notification->sendEmail($records);
|
||||
$parents_status = 0;
|
||||
$receiving_status = 0;
|
||||
@ -67,17 +68,20 @@ class Notifications extends BaseController
|
||||
$params->group_id = $records['group_id'];
|
||||
} else {
|
||||
session()->setFlashdata('error', 'Group Id Missing Please Try again..');
|
||||
$data['page_name'] = 'Custom Notifications';
|
||||
$this->render_page('notifications_form', $data);
|
||||
return;
|
||||
}
|
||||
}else if ($records['categories'] == 'SEND_WAAI_URL') {
|
||||
if ($records['mobile'] == "") {
|
||||
session()->setFlashdata('error', 'Mobile Number Missing Please Try again..');
|
||||
$data['page_name'] = 'Custom Notifications';
|
||||
$this->render_page('notifications_form', $data);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
session()->setFlashdata('error', 'Please Choose your Category..');
|
||||
$data['page_name'] = 'Custom Notifications';
|
||||
$this->render_page('notifications_form', $data);
|
||||
return;
|
||||
}
|
||||
@ -89,6 +93,7 @@ class Notifications extends BaseController
|
||||
$params->type = "media";
|
||||
} else {
|
||||
session()->setFlashdata('error', 'Media Url Missing Please Try again..');
|
||||
$data['page_name'] = 'Custom Notifications';
|
||||
$this->render_page('notifications_form', $data);
|
||||
return;
|
||||
}
|
||||
@ -98,12 +103,14 @@ class Notifications extends BaseController
|
||||
|
||||
if (empty($doc_details)) {
|
||||
session()->setFlashdata('error', 'Please select a file to upload.');
|
||||
$data['page_name'] = 'Custom Notifications';
|
||||
$this->render_page('notifications_form', $data);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$doc_details->isValid() || $doc_details->getClientMimeType() !== 'image/jpeg') {
|
||||
session()->setFlashdata('error', 'Please upload a valid JPEG image.');
|
||||
$data['page_name'] = 'Custom Notifications';
|
||||
$this->render_page('notifications_form', $data);
|
||||
return;
|
||||
}
|
||||
@ -113,6 +120,7 @@ class Notifications extends BaseController
|
||||
if ($doc_name === '') {
|
||||
$this->logger->error("Err on upload: name not found");
|
||||
session()->setFlashdata('error', 'Document name not found. Please try again.');
|
||||
$data['page_name'] = 'Custom Notifications';
|
||||
$this->render_page('notifications_form', $data);
|
||||
return;
|
||||
}
|
||||
@ -207,22 +215,26 @@ class Notifications extends BaseController
|
||||
session()->setFlashdata("success","Message : Sent Success (". $sended_number_count." / ".$total_number_count." )");
|
||||
$this->logger->error("Whatsapp : Final ==> ".$sended_number_count." Sended out of ".$total_number_count." ( Not sended numbers count ".$not_sended_number_count." ) ");
|
||||
}
|
||||
$data['page_name'] = 'Custom Notifications';
|
||||
$this->render_page('notifications_form', $data);
|
||||
return;
|
||||
}else{
|
||||
session()->setFlashdata('error', 'Message : Mobile Not Founded');
|
||||
$this->logger->error('Message : Mobile Not Founded');
|
||||
$data['page_name'] = 'Custom Notifications';
|
||||
$this->render_page('notifications_form', $data);
|
||||
return;
|
||||
}
|
||||
}else{
|
||||
session()->setFlashdata('error', 'Message : Mobile Field Empty');
|
||||
$this->logger->error('Message : Mobile Field Empty');
|
||||
$this->logger->error('Message : Mobile Field Empty');
|
||||
$data['page_name'] = 'Custom Notifications';
|
||||
$this->render_page('notifications_form', $data);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
$data['page_name'] = 'Custom Notifications';
|
||||
$this->render_page('notifications_form', $data);
|
||||
}
|
||||
|
||||
@ -803,7 +815,24 @@ class Notifications extends BaseController
|
||||
{
|
||||
foreach($customer_details as $customer)
|
||||
{
|
||||
|
||||
|
||||
$customer['customer_name'] = isset($customer['customer_name'])
|
||||
? $customer['customer_name']
|
||||
: (isset($customer['first_name']) && isset($customer['last_name'])
|
||||
? $customer['first_name'] . ' ' . $customer['last_name']
|
||||
: '');
|
||||
$customer['scheme_name'] = isset($customer['scheme_name']) ? $customer['scheme_name'] : (isset($customer['title']) ? $customer['title'] : "");
|
||||
$formatted_due_date = "";
|
||||
|
||||
if(isset($customer['to_subscription'])){
|
||||
$dateObj = date_create($customer['to_subscription']);
|
||||
$formatted_due_date = date_format($dateObj, 'd-m-Y');
|
||||
}else{
|
||||
$formatted_due_date = $customer['formatted_due_date'];
|
||||
}
|
||||
$customer['formatted_due_date'] = $formatted_due_date;
|
||||
|
||||
|
||||
#step 4 replace templates palceholders with data points
|
||||
$notificationContent = $this->replaceTemplateWithDataPoints($template['message'],$customer);
|
||||
$history_child_data = [
|
||||
@ -879,15 +908,21 @@ class Notifications extends BaseController
|
||||
function getScheduledNotificationDetails()
|
||||
{
|
||||
$model = new NotificationModel();
|
||||
$today = date('Y-m-d');
|
||||
$currentTime = date('H:i:s');
|
||||
$endTime = date('H:i:s', strtotime('+30 minutes'));
|
||||
$where = ['scheduled_date' => $today,'isactive' => 1,
|
||||
'scheduled_time >=' => $currentTime,
|
||||
'scheduled_time <=' => $endTime
|
||||
];
|
||||
$templateIds = [1, 2];
|
||||
$model->setTable('notification_campaign');
|
||||
$notification_campaign_result = $model->where($where)->findAll();
|
||||
$notification_campaign_result = $model->whereIn('template_id', $templateIds)->where('isactive', 1)->findAll();
|
||||
|
||||
// $today = date('Y-m-d');
|
||||
// $currentTime = date('H:i:s');
|
||||
// $endTime = date('H:i:s', strtotime('+30 minutes'));
|
||||
// $where = ['scheduled_date' => $today,'isactive' => 1,
|
||||
// 'scheduled_time >=' => $currentTime,
|
||||
// 'scheduled_time <=' => $endTime
|
||||
// ];
|
||||
// $model->setTable('notification_campaign');
|
||||
// $notification_campaign_result = $model->where($where)->findAll();
|
||||
// echo $model->getLastQuery();
|
||||
|
||||
return $notification_campaign_result;
|
||||
}
|
||||
|
||||
|
||||
@ -20,6 +20,7 @@ class NotificationModel extends Model
|
||||
// ->findAll();
|
||||
// }
|
||||
|
||||
/** This Function used for due_date_notifications routes */
|
||||
public function getSubscriptionDueDetail($date){
|
||||
// $now = date('Y-m-d');
|
||||
// $lastWeek = date('Y-m-d', strtotime('+7 days'));
|
||||
|
||||
@ -76,7 +76,7 @@
|
||||
<div class="form-group row">
|
||||
<label for="body" class="col-3 col-form-label">Body<span class="text-danger"> *</span></label>
|
||||
<div class="col-9">
|
||||
<textarea id="summernote-basic" name="description" class="form-control" rows="7">
|
||||
<textarea id="summernote-basic" name="maildescription" class="form-control" rows="7">
|
||||
<h5>Hello {USER_NAME}, </h5>
|
||||
<p>We create simple, flat & responsive custom mail template.</p>
|
||||
<p>Please, write text here!</p>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user