59 lines
1.8 KiB
PHP
59 lines
1.8 KiB
PHP
<?php
|
|
|
|
|
|
class CUSTOM_PDALERTS
|
|
{
|
|
|
|
|
|
|
|
/*
|
|
This function plays role of sending sms/email while PD status changing.
|
|
@param pdid
|
|
get current status, lender, created by, allocated_to, etc by using pdid.
|
|
then get pd notification config's using current pd status.
|
|
based on that pd config's send sms/email to endpoints
|
|
|
|
*/
|
|
|
|
public static function custom_pdnotification($CI,$core_details)
|
|
{
|
|
|
|
//echo 'CUSTOM';
|
|
/********************CUSTOM MAIL NOTIFICATION***********************/
|
|
if(($core_details[0]['pd_status'] == 'TRIGGERED') && ($core_details[0]['short_name'] == 'IIB' || $core_details[0]['short_name'] == 'UDAAN' || $core_details[0]['short_name'] == 'IMGC'))
|
|
{
|
|
|
|
//get msg config
|
|
$CI->db->SELECT("*");
|
|
$CI->db->FROM(PDNOTIFICATIONMSG." as PDNOTIFICATIONMSG");
|
|
$CI->db->WHERE("PDNOTIFICATIONMSG.pd_status",$core_details[0]['pd_status']);
|
|
$CI->db->WHERE("PDNOTIFICATIONMSG.isactive",1);
|
|
$pd_notification_msg = $CI->db->GET()->result_array();
|
|
|
|
$msg = $pd_notification_msg[0]['pdincharge'];
|
|
$msg = PDALERTS::stringReplace($msg,$core_details);
|
|
$additional_data_for_logs['to_whom'] = 'LEDNER';
|
|
|
|
if(ENVIRONMENT == 'production')
|
|
{
|
|
PDALERTS::sendMail($CI,'sinepd@sinemanagement.com',$msg,$core_details);
|
|
log_message('ERROR','###CUSTOM MAIL TRIGGERED to sinepd@sinemanagement.com');
|
|
}
|
|
else if(ENVIRONMENT == 'testing')
|
|
{
|
|
//echo 'TESTING';
|
|
PDALERTS::sendMail($CI,'ssa@venbainfotech.com',$msg,$core_details);
|
|
//PDALERTS::sendMail($CI,'vitvelz@gmail.com',$msg,$core_details);
|
|
log_message('ERROR','###CUSTOM MAIL TRIGGERED to ssa@venbainfotech.com');
|
|
}
|
|
}
|
|
|
|
/********************************************************/
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
?>
|