1343 lines
63 KiB
PHP
Executable File
1343 lines
63 KiB
PHP
Executable File
<style>
|
||
#notification_table{
|
||
overflow-x : unset;
|
||
}
|
||
.preview_button{
|
||
display:none;
|
||
}
|
||
|
||
.scrollb {
|
||
overflow-y: auto !important;
|
||
}
|
||
</style>
|
||
<div class="tab-pane fade" id="notification-tab">
|
||
<input type="hidden" id="client_id_for_client_branch" value="<?= isset($notification['id']) ? $notification['id'] : '' ?>"/>
|
||
<div class="row float-right" style="padding-bottom: 10px;position: relative;right: 13px;">
|
||
</div>
|
||
|
||
<div class="table-responsive" id="notification_table" >
|
||
|
||
<!-- <form id="notification_enable_form"> -->
|
||
|
||
<div>
|
||
<p><?php
|
||
|
||
// print_r($notification);
|
||
$member_welcome_mail = 0;
|
||
$member_reminder_mail = 0;
|
||
$member_ecard_mail = 0;
|
||
$member_review_and_summary_mail = 0;
|
||
$account_maneger_summary_mail = 0;
|
||
$client_hr_summary_mail = 0;
|
||
if(isset($notification)){
|
||
foreach($notification as $value){
|
||
|
||
if ($value['template_name'] == 'member_welcome_mail') {
|
||
$member_welcome_mail = $value['enabled'];
|
||
}
|
||
|
||
if ($value['template_name'] == 'member_reminder_mail') {
|
||
$member_reminder_mail = $value['enabled'];
|
||
}
|
||
|
||
if ($value['template_name'] == 'member_ecard_mail') {
|
||
$member_ecard_mail = $value['enabled'];
|
||
}
|
||
|
||
if ($value['template_name'] == 'member_review_and_summary_mail') {
|
||
$member_review_and_summary_mail = $value['enabled'];
|
||
}
|
||
|
||
if ($value['template_name'] == 'account_maneger_summary_mail') {
|
||
$account_maneger_summary_mail = $value['enabled'];
|
||
}
|
||
|
||
if ($value['template_name'] == 'client_hr_summary_mail') {
|
||
$client_hr_summary_mail = $value['enabled'];
|
||
}
|
||
}
|
||
}
|
||
?></p>
|
||
</div>
|
||
<div class="form-group">
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-6">
|
||
<label for="branch_name">Team mail ID<span class="text-danger"></span></label>
|
||
<textarea name="" id="nhance_team_mail_ids" class="form-control" placeholder="Example: jhon@gmail.com, dave@gmail.com"><?php echo isset($client['common_mails']) ? $client['common_mails'] : ''; ?></textarea>
|
||
</div>
|
||
<div class="form-group col-md-6">
|
||
<label for="branch_name">HR mail ID<span class="text-danger"></span></label>
|
||
<textarea name="" id="hr_mail_id" class="form-control" placeholder="Example: jhon@gmail.com, dave@gmail.com"><?php echo isset($client['hr_mails']) ? $client['hr_mails'] : ''; ?></textarea>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-6">
|
||
<label for="mail_domain">Mail Domain<span class="text-danger"></span></label>
|
||
<input type="text" name="" id="mail_domain" class="form-control" placeholder="Only one Domain Name. Example: nhance.com" value="<?php echo isset($client['mail_domain']) ? $client['mail_domain'] : ''; ?>">
|
||
</div>
|
||
<div class="form-group col-md-6">
|
||
<label for="reply_to">Reply To Mail<span class="text-danger"></span></label>
|
||
<input type="text" name="" id="reply_to" class="form-control" placeholder="Only one Reply-to mail. Example: jhon@gmail.com" value="<?php echo isset($client['reply_to']) ? $client['reply_to'] : ''; ?>">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-6">
|
||
<label for="branch_name">Member welcome mail</label>
|
||
<label class="switch">
|
||
<input id="member_welcome_mail_btn" type="checkbox" name="member_welcome_mail_btn" <?= ($member_welcome_mail == 1) ? 'checked' : '' ?>>
|
||
<span class="slider round" style="height: 27px;"></span>
|
||
</label>
|
||
|
||
<a href="" data-toggle="modal" id="member_welcome_mail" onclick="getMailTemplateData(this)" data-target="#member_welcome_mail_modal">Edit</a>
|
||
</div>
|
||
<div class="form-group col-md-5">
|
||
<textarea style="display:none;" name="" id="" class="form-control "></textarea>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-6">
|
||
<label for="branch_name">Member reminder mail</label>
|
||
<label class="switch">
|
||
<input id="member_reminder_mail_btn" type="checkbox" name="member_reminder_mail_btn" <?= $member_reminder_mail == 1 ? 'checked' : '' ?>>
|
||
<span class="slider round" style="height: 27px;"></span>
|
||
</label>
|
||
|
||
<a href="" data-toggle="modal" id="member_reminder_mail" onclick="getMailTemplateData(this)" data-target="#member_reminder_mail_modal">Edit</a>
|
||
</div>
|
||
<div class="form-group col-md-5">
|
||
<textarea style="display:none;" name="" id="" class="form-control "></textarea>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-6">
|
||
<label for="branch_name">Member ECard mail</label>
|
||
<label class="switch">
|
||
<input id="member_ecard_mail_btn" type="checkbox" name="member_ecard_mail_btn" <?= $member_ecard_mail == 1 ? 'checked' : '' ?>>
|
||
<span class="slider round" style="height: 27px;"></span>
|
||
</label>
|
||
|
||
<a href="" data-toggle="modal" id="member_ecard_mail" onclick="getMailTemplateData(this)" data-target="#member_ecard_mail_modal">Edit</a>
|
||
</div>
|
||
<div class="form-group col-md-5">
|
||
<textarea style="display:none;" name="" id="" class="form-control "></textarea>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-6">
|
||
<label for="branch_name">Member Review and summary mail</label>
|
||
<label class="switch">
|
||
<input id="member_review_and_summary_mail_btn" type="checkbox" name="member_review_and_summary_mail_btn" <?= $member_review_and_summary_mail == 1 ? 'checked' : '' ?>>
|
||
<span class="slider round" style="height: 27px;"></span>
|
||
</label>
|
||
|
||
<a href="" data-toggle="modal" id="member_review_and_summary_mail" onclick="getMailTemplateData(this)" data-target="#member_review_and_summary_mail_modal">Edit</a>
|
||
</div>
|
||
<div class="form-group col-md-5">
|
||
<textarea style="display:none;" name="" id="" class="form-control "></textarea>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-6">
|
||
<label for="branch_name">Account Maneger summary mail</label>
|
||
<label class="switch">
|
||
<input id="account_maneger_summary_mail_btn" type="checkbox" name="account_maneger_summary_mail_btn" <?= $account_maneger_summary_mail ? 'checked' : '' ?>>
|
||
<span class="slider round" style="height: 27px;"></span>
|
||
</label>
|
||
|
||
<a href="" data-toggle="modal" id="account_maneger_summary_mail" onclick="getMailTemplateData(this)" data-target="#account_maneger_summary_mail_modal">Edit</a>
|
||
</div>
|
||
<div class="form-group col-md-5">
|
||
<textarea style="display:none;" name="" id="" class="form-control "></textarea>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-6">
|
||
<label for="branch_name">Client HR summary mail</label>
|
||
<label class="switch">
|
||
<input id="client_hr_summary_mail_btn" type="checkbox" name="client_hr_summary_mail_btn" <?= $client_hr_summary_mail == 1 ? 'checked' : '' ?>>
|
||
<span class="slider round" style="height: 27px;"></span>
|
||
</label>
|
||
|
||
<a href="" data-toggle="modal" id="client_hr_summary_mail" onclick="getMailTemplateData(this)" data-target="#client_hr_summary_mail_modal">Edit</a>
|
||
</div>
|
||
<div class="form-group col-md-5">
|
||
<textarea style="display:none;" name="" id="" class="form-control "></textarea>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-6">
|
||
</div>
|
||
<div class="form-group col-md-6">
|
||
<a style="float:right;" id="notification_enable_form_submit" class="btn btn-primary waves-effect waves-light mr-1">Submit</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- </form> -->
|
||
</div>
|
||
|
||
</div>
|
||
<!-- end -->
|
||
|
||
|
||
|
||
<!-- Modal content for the Large example -->
|
||
<div class="modal fade" id="member_welcome_mail_modal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel"
|
||
aria-hidden="true" aria-modal="true" data-backdrop="static">
|
||
<div class="modal-dialog modal-full-width scrollb" >
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h4 class="modal-title" id="myLargeModalLabel">Member welcome mail <span id="nameOfThePolicy"></span></h4>
|
||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||
</div>
|
||
<div class="modal-body">
|
||
|
||
<div class="text-center" id="no_data"></div>
|
||
|
||
<form role="form" class="parsley-examples" method="post" id="member_welcome_mail_form" enctype="multipart/form-data">
|
||
|
||
<div class="form-group">
|
||
|
||
<div class="form-row" id="rac_rate_dropdown">
|
||
<div class="form-group col-md-2">
|
||
<label for="emp_code">Template Name</label>
|
||
</div>
|
||
<div class="form-group col-md-5">
|
||
<input type="text" id="template_name" name="template_name" class="form-control" value="Member Welcome Mail" readonly placeholder="Template Name">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row" id="rac_rate_dropdown">
|
||
<div class="form-group col-md-2">
|
||
<label for="emp_code">Subject</label>
|
||
</div>
|
||
<div class="form-group col-md-5">
|
||
<input type="text" id="subject" name="subject" class="form-control" placeholder="Subject">
|
||
</div>
|
||
<div class="form-group col-md-2 testmail" style="display: none;">
|
||
<a class="btn btn-primary waves-effect waves-light mr-1 setid" onclick="testMailSend(this)">Test Mail</a>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row" id="rac_rate_dropdown">
|
||
<div class="form-group col-md-12">
|
||
<select id="member_welcome_mail_customButton" class="form-control" style="border:none;right: 6px;width: auto;position: absolute;z-index: 1;top: 17px;height: 32px;float: right;">
|
||
<option value="">PlaceHolders</option>
|
||
<?php foreach ($placeHolders as $value): ?>
|
||
<?php if($value == 'member_name' || $value == 'nhance_logo' || $value == 'client_logo' || $value == 'app_link' || $value == 'client_name'){ ?>
|
||
<?php $valueChange = str_replace('_', ' ', $value); $valueChange = ucwords($valueChange); ?>
|
||
<option value="[[<?php echo $value; ?>]]"><?php echo $valueChange; ?></option>
|
||
<?php } ?>
|
||
<?php endforeach; ?>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="member_welcome_mail_snow_editor" name="content" style="height: 300px;">
|
||
|
||
</div>
|
||
|
||
<input type="file" id="Question_title_fileInput" style="display: none;">
|
||
|
||
</div>
|
||
|
||
<div class="form-group text-right m-b-0">
|
||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
|
||
id="btnGridSubmit_2">Submit</button>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div><!-- /.modal-content -->
|
||
</div><!-- /.modal-dialog -->
|
||
</div><!-- /.modal -->
|
||
|
||
<!-- Modal content for the Large example -->
|
||
<div class="modal fade" id="member_reminder_mail_modal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="false" aria-modal="true">
|
||
<div class="modal-dialog modal-full-width">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h4 class="modal-title" id="myLargeModalLabel">Member reminder mail <span id="nameOfThePolicy"></span></h4>
|
||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||
</div>
|
||
<div class="modal-body">
|
||
|
||
<div class="text-center" id="no_data"></div>
|
||
|
||
<form role="form" class="parsley-examples" method="post" id="member_reminder_mail_form" enctype="multipart/form-data">
|
||
|
||
<div class="form-group">
|
||
|
||
<div class="form-row" id="rac_rate_dropdown">
|
||
<div class="form-group col-md-2">
|
||
<label for="emp_code">Template Name</label>
|
||
</div>
|
||
<div class="form-group col-md-5">
|
||
<input type="text" id="template_name" name="template_name" class="form-control" value="Member Reminder Mail" readonly placeholder="Template Name">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row" id="rac_rate_dropdown">
|
||
<div class="form-group col-md-2">
|
||
<label for="emp_code">Subject</label>
|
||
</div>
|
||
<div class="form-group col-md-5">
|
||
<input type="text" id="subject" name="subject" class="form-control" placeholder="Subject">
|
||
</div>
|
||
<div class="form-group col-md-2 testmail" style="display: none;">
|
||
<a class="btn btn-primary waves-effect waves-light mr-1 setid" onclick="testMailSend(this)">Test Mail</a>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- <div class="form-row" id="rac_rate_dropdown">
|
||
<div class="form-group col-md-12">
|
||
<select name="" id="" class="form-control" style="z-index: 1;float: right;position: absolute;margin-top: 18px;right: 53px;width: 100px;height: 30px;">
|
||
<option value="">1</option>
|
||
<option value="">2</option>
|
||
<option value="">3</option>
|
||
<option value="">4</option>
|
||
<option value="">6</option>
|
||
</select>
|
||
</div>
|
||
</div> -->
|
||
<div class="form-row" id="rac_rate_dropdown">
|
||
<div class="form-group col-md-12">
|
||
<select id="member_reminder_mail_modal_customButton" class="form-control" style="border:none;right: 6px;width: auto;position: absolute;z-index: 1;top: 17px;height: 32px;float: right;">
|
||
<option value="">PlaceHolders</option>
|
||
<?php foreach ($placeHolders as $value): ?>
|
||
<?php if($value == 'member_name' || $value == 'nhance_logo' || $value == 'client_logo' || $value == 'app_link' || $value == 'client_name'){ ?>
|
||
<?php $valueChange = str_replace('_', ' ', $value); $valueChange = ucwords($valueChange); ?>
|
||
<option value="[[<?php echo $value; ?>]]"><?php echo $valueChange; ?></option>
|
||
<?php } ?>
|
||
<?php endforeach; ?>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="member_reminder_mail_snow_editor" style="height: 300px;">
|
||
|
||
</div>
|
||
|
||
|
||
<div id="editor" name="content"></div>
|
||
|
||
|
||
<input type="file" id="Question_title_fileInput" style="display: none;">
|
||
|
||
</div>
|
||
|
||
<div class="form-group text-right m-b-0">
|
||
<button class="btn btn-primary waves-effect waves-light mr-1 preview_button"
|
||
id="">Preview</button>
|
||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
|
||
id="btnGridSubmit_2">Submit</button>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div><!-- /.modal-content -->
|
||
</div><!-- /.modal-dialog -->
|
||
</div><!-- /.modal -->
|
||
|
||
<!-- Modal content for the Large example -->
|
||
<div class="modal fade" id="member_ecard_mail_modal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel"
|
||
aria-hidden="true" aria-modal="true" data-backdrop="static">
|
||
<div class="modal-dialog modal-full-width">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h4 class="modal-title" id="myLargeModalLabel">Member ecard mail <span id="nameOfThePolicy"></span></h4>
|
||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||
</div>
|
||
<div class="modal-body">
|
||
|
||
<div class="text-center" id="no_data"></div>
|
||
|
||
<form role="form" class="parsley-examples" method="post" id="member_ecard_mail_form" enctype="multipart/form-data">
|
||
|
||
<div class="form-group">
|
||
|
||
<div class="form-row" id="rac_rate_dropdown">
|
||
<div class="form-group col-md-2">
|
||
<label for="emp_code">Template Name</label>
|
||
</div>
|
||
<div class="form-group col-md-5">
|
||
<input type="text" id="template_name" name="template_name" class="form-control" value="Member Ecard Mail" readonly placeholder="Template Name">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row" id="rac_rate_dropdown">
|
||
<div class="form-group col-md-2">
|
||
<label for="emp_code">Subject</label>
|
||
</div>
|
||
<div class="form-group col-md-5">
|
||
<input type="text" id="subject" name="subject" class="form-control" placeholder="Subject">
|
||
</div>
|
||
<div class="form-group col-md-2 testmail" style="display: none;">
|
||
<a class="btn btn-primary waves-effect waves-light mr-1 setid" onclick="testMailSend(this)">Test Mail</a>
|
||
</div>
|
||
</div>
|
||
<div class="form-row" id="rac_rate_dropdown">
|
||
<div class="form-group col-md-12">
|
||
<select id="member_ecard_mail_modal_customButton" class="form-control" style="border:none;right: 6px;width: auto;position: absolute;z-index: 1;top: 17px;height: 32px;float: right;">
|
||
<option value="">PlaceHolders</option>
|
||
<?php foreach ($placeHolders as $value): ?>
|
||
|
||
<?php if($value == 'member_name' || $value == 'nhance_logo' || $value == 'client_logo' || $value == 'app_link' || $value == 'post_enrollment_app_link' || $value == 'client_name' || $value == 'ecard_download_link'){ ?>
|
||
<?php $valueChange = str_replace('_', ' ', $value); $valueChange = ucwords($valueChange); ?>
|
||
<option value="[[<?php echo $value; ?>]]"><?php echo $valueChange; ?></option>
|
||
<?php } ?>
|
||
<?php endforeach; ?>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="member_ecard_mail_snow_editor" style="height: 300px;">
|
||
|
||
</div>
|
||
|
||
|
||
<div id="editor" name="content"></div>
|
||
|
||
|
||
<input type="file" id="Question_title_fileInput" style="display: none;">
|
||
|
||
</div>
|
||
|
||
<div class="form-group text-right m-b-0">
|
||
<button class="btn btn-primary waves-effect waves-light mr-1 preview_button"
|
||
id="">Preview</button>
|
||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
|
||
id="btnGridSubmit_2">Submit</button>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div><!-- /.modal-content -->
|
||
</div><!-- /.modal-dialog -->
|
||
</div><!-- /.modal -->
|
||
|
||
<!-- Modal content for the Large example -->
|
||
<div class="modal fade" id="member_review_and_summary_mail_modal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel"
|
||
aria-hidden="true" aria-modal="true" data-backdrop="static">
|
||
<div class="modal-dialog modal-full-width">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h4 class="modal-title" id="myLargeModalLabel">Member Review and summary mail <span id="nameOfThePolicy"></span></h4>
|
||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||
</div>
|
||
<div class="modal-body">
|
||
|
||
<div class="text-center" id="no_data"></div>
|
||
|
||
<form role="form" class="parsley-examples" method="post" id="member_review_and_summary_mail_form" enctype="multipart/form-data">
|
||
|
||
<div class="form-group">
|
||
|
||
<div class="form-row" id="rac_rate_dropdown">
|
||
<div class="form-group col-md-2">
|
||
<label for="emp_code">Template Name</label>
|
||
</div>
|
||
<div class="form-group col-md-5">
|
||
<input type="text" id="template_name" name="template_name" value="Member Review and Summary Mail" readonly class="form-control" placeholder="Template Name">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row" id="rac_rate_dropdown">
|
||
<div class="form-group col-md-2">
|
||
<label for="emp_code">Subject</label>
|
||
</div>
|
||
<div class="form-group col-md-5">
|
||
<input type="text" id="subject" name="subject" class="form-control" placeholder="Subject">
|
||
</div>
|
||
<div class="form-group col-md-2 testmail" style="display: none;">
|
||
<a class="btn btn-primary waves-effect waves-light mr-1 setid" onclick="testMailSend(this)">Test Mail</a>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- <div class="form-row" id="rac_rate_dropdown">
|
||
<div class="form-group col-md-12">
|
||
<select name="" id="" class="form-control" style="z-index: 1;float: right;position: absolute;margin-top: 18px;right: 53px;width: 100px;height: 30px;">
|
||
<option value="">1</option>
|
||
<option value="">2</option>
|
||
<option value="">3</option>
|
||
<option value="">4</option>
|
||
<option value="">6</option>
|
||
</select>
|
||
</div>
|
||
</div> -->
|
||
<div class="form-row" id="rac_rate_dropdown">
|
||
<div class="form-group col-md-12">
|
||
<select id="member_review_and_summary_mail_modal_customButton" class="form-control" style="border:none;right: 6px;width: auto;position: absolute;z-index: 1;top: 17px;height: 32px;float: right;">
|
||
<option value="">PlaceHolders</option>
|
||
<?php foreach ($placeHolders as $value): ?>
|
||
<?php if($value == 'member_name' || $value == 'nhance_logo' || $value == 'client_logo' || $value == 'app_link' || $value == 'client_name' || $value == 'member_summary'){ ?>
|
||
<?php $valueChange = str_replace('_', ' ', $value); $valueChange = ucwords($valueChange); ?>
|
||
<option value="[[<?php echo $value; ?>]]"><?php echo $valueChange; ?></option>
|
||
<?php } ?>
|
||
<?php endforeach; ?>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="member_review_and_summary" style="height: 300px;">
|
||
|
||
</div>
|
||
|
||
|
||
<div id="editor"></div>
|
||
|
||
|
||
<input type="file" id="Question_title_fileInput" style="display: none;">
|
||
|
||
</div>
|
||
|
||
<div class="form-group text-right m-b-0">
|
||
<button class="btn btn-primary waves-effect waves-light mr-1 preview_button"
|
||
id="">Preview</button>
|
||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
|
||
id="btnGridSubmit_2">Submit</button>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div><!-- /.modal-content -->
|
||
</div><!-- /.modal-dialog -->
|
||
</div><!-- /.modal -->
|
||
|
||
<!-- Modal content for the Large example -->
|
||
<div class="modal fade" id="account_maneger_summary_mail_modal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel"
|
||
aria-hidden="true" aria-modal="true" data-backdrop="static">
|
||
<div class="modal-dialog modal-full-width">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h4 class="modal-title" id="myLargeModalLabel">Member Review and summary mail <span id="nameOfThePolicy"></span></h4>
|
||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||
</div>
|
||
<div class="modal-body">
|
||
|
||
<div class="text-center" id="no_data"></div>
|
||
|
||
<form role="form" class="parsley-examples" method="post" id="account_maneger_summary_mail_form" enctype="multipart/form-data">
|
||
|
||
<div class="form-group">
|
||
|
||
<div class="form-row" id="rac_rate_dropdown">
|
||
<div class="form-group col-md-2">
|
||
<label for="emp_code">Template Name</label>
|
||
</div>
|
||
<div class="form-group col-md-5">
|
||
<input type="text" id="template_name" name="template_name" value="Account Maneger Summary Mail" readonly class="form-control" placeholder="Template Name">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row" id="rac_rate_dropdown">
|
||
<div class="form-group col-md-2">
|
||
<label for="emp_code">Subject</label>
|
||
</div>
|
||
<div class="form-group col-md-5">
|
||
<input type="text" id="subject" name="subject" class="form-control" placeholder="Subject">
|
||
</div>
|
||
<div class="form-group col-md-2 testmail" style="display: none;">
|
||
<a class="btn btn-primary waves-effect waves-light mr-1 setid" onclick="testMailSend(this)">Test Mail</a>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- <div class="form-row" id="rac_rate_dropdown">
|
||
<div class="form-group col-md-12">
|
||
<select name="" id="" class="form-control" style="z-index: 1;float: right;position: absolute;margin-top: 18px;right: 53px;width: 100px;height: 30px;">
|
||
<option value="">1</option>
|
||
<option value="">2</option>
|
||
<option value="">3</option>
|
||
<option value="">4</option>
|
||
<option value="">6</option>
|
||
</select>
|
||
</div>
|
||
</div> -->
|
||
<div class="form-row" id="rac_rate_dropdown">
|
||
<div class="form-group col-md-12">
|
||
<select id="account_maneger_summary_mail_modal_customButton" class="form-control" style="border:none;right: 6px;width: auto;position: absolute;z-index: 1;top: 17px;height: 32px;float: right;">
|
||
<option value="">PlaceHolders</option>
|
||
<?php foreach ($placeHolders as $value): ?>
|
||
<?php if($value == 'member_name' || $value == 'nhance_logo' || $value == 'client_logo' || $value == 'app_link' || $value == 'client_name' || $value == 'member_summary'){ ?>
|
||
<?php $valueChange = str_replace('_', ' ', $value); $valueChange = ucwords($valueChange); ?>
|
||
<option value="[[<?php echo $value; ?>]]"><?php echo $valueChange; ?></option>
|
||
<?php } ?>
|
||
<?php endforeach; ?>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="account_maneger_summary_mail_snow_editor" style="height: 300px;">
|
||
|
||
</div>
|
||
|
||
|
||
<div id="editor"></div>
|
||
|
||
|
||
<input type="file" id="Question_title_fileInput" style="display: none;">
|
||
|
||
</div>
|
||
|
||
<div class="form-group text-right m-b-0">
|
||
<button class="btn btn-primary waves-effect waves-light mr-1 preview_button"
|
||
id="">Preview</button>
|
||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
|
||
id="btnGridSubmit_2">Submit</button>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div><!-- /.modal-content -->
|
||
</div><!-- /.modal-dialog -->
|
||
</div><!-- /.modal -->
|
||
|
||
<!-- Modal content for the Large example -->
|
||
<div class="modal fade" id="client_hr_summary_mail_modal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel"
|
||
aria-hidden="true" aria-modal="true" data-backdrop="static">
|
||
<div class="modal-dialog modal-full-width">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h4 class="modal-title" id="myLargeModalLabel">Member Review and summary mail <span id="nameOfThePolicy"></span></h4>
|
||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||
</div>
|
||
<div class="modal-body">
|
||
|
||
<div class="text-center" id="no_data"></div>
|
||
|
||
<form role="form" class="parsley-examples" method="post" id="client_hr_summary_mail_form" enctype="multipart/form-data">
|
||
|
||
<div class="form-group">
|
||
|
||
<div class="form-row" id="rac_rate_dropdown">
|
||
<div class="form-group col-md-2">
|
||
<label for="emp_code">Template Name</label>
|
||
</div>
|
||
<div class="form-group col-md-5">
|
||
<input type="text" id="template_name" name="template_name" value="Client HR Summary Mail" readonly class="form-control" placeholder="Template Name">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row" id="rac_rate_dropdown">
|
||
<div class="form-group col-md-2">
|
||
<label for="emp_code">Subject</label>
|
||
</div>
|
||
<div class="form-group col-md-5">
|
||
<input type="text" id="subject" name="subject" class="form-control" placeholder="Subject">
|
||
</div>
|
||
<div class="form-group col-md-2 testmail" style="display: none;">
|
||
<a class="btn btn-primary waves-effect waves-light mr-1 setid" onclick="testMailSend(this)">Test Mail</a>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- <div class="form-row" id="rac_rate_dropdown">
|
||
<div class="form-group col-md-12">
|
||
<select name="" id="" class="form-control" style="z-index: 1;float: right;position: absolute;margin-top: 18px;right: 53px;width: 100px;height: 30px;">
|
||
<option value="">1</option>
|
||
<option value="">2</option>
|
||
<option value="">3</option>
|
||
<option value="">4</option>
|
||
<option value="">6</option>
|
||
</select>
|
||
</div>
|
||
</div> -->
|
||
<div class="form-row" id="rac_rate_dropdown">
|
||
<div class="form-group col-md-12">
|
||
<select id="client_hr_summary_mail_modal_customButton" class="form-control" style="border:none;right: 6px;width: auto;position: absolute;z-index: 1;top: 17px;height: 32px;float: right;">
|
||
<option value="">PlaceHolders</option>
|
||
<?php foreach ($placeHolders as $value): ?>
|
||
<?php if($value == 'member_name' || $value == 'nhance_logo' || $value == 'client_logo' || $value == 'app_link' || $value == 'client_name' || $value == 'member_summary'){ ?>
|
||
<?php $valueChange = str_replace('_', ' ', $value); $valueChange = ucwords($valueChange); ?>
|
||
<option value="[[<?php echo $value; ?>]]"><?php echo $valueChange; ?></option>
|
||
<?php } ?>
|
||
<?php endforeach; ?>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="client_hr_summary" style="height: 300px;">
|
||
|
||
</div>
|
||
|
||
|
||
<div id="editor"></div>
|
||
|
||
|
||
<input type="file" id="Question_title_fileInput" style="display: none;">
|
||
|
||
</div>
|
||
|
||
<div class="form-group text-right m-b-0">
|
||
<button class="btn btn-primary waves-effect waves-light mr-1 preview_button"
|
||
id="">Preview</button>
|
||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
|
||
id="btnGridSubmit_2">Submit</button>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div><!-- /.modal-content -->
|
||
</div><!-- /.modal-dialog -->
|
||
</div><!-- /.modal -->
|
||
|
||
|
||
|
||
<div class="modal fade" id="preview_modal" tabindex="-1" role="dialog" aria-hidden="false" aria-modal="true" data-backdrop="static">
|
||
<div class="modal-dialog modal-dialog-centered">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h4 class="modal-title" id="myLargeModalLabel">Testing Mail Data<span id="nameOfThePolicy"></span></h4>
|
||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||
</div>
|
||
<div class="modal-body">
|
||
|
||
<div class="text-center" id="no_data"></div>
|
||
|
||
</div>
|
||
</div><!-- /.modal-content -->
|
||
</div><!-- /.modal-dialog -->
|
||
</div><!-- /.modal -->
|
||
|
||
<script>
|
||
|
||
|
||
// document.addEventListener('DOMContentLoaded', function () {
|
||
|
||
// console.log('DOMContentLoaded start');
|
||
|
||
// var memberWelcomeMailModal = new bootstrap.Modal(document.getElementById('member_welcome_mail_modal'));
|
||
// var previewModal = new bootstrap.Modal(document.getElementById('preview_modal'));
|
||
|
||
|
||
// document.getElementById('preview_modal').addEventListener('hidden.bs.modal', function () {
|
||
// console.log('testing modal');
|
||
// memberWelcomeMailModal.show();
|
||
// console.log('testing modal end');
|
||
// });
|
||
|
||
// console.log('DOMContentLoaded end');
|
||
|
||
// });
|
||
|
||
$(document).on('hide.bs.modal', '.modal', function () {
|
||
console.log("Modal is hidden");
|
||
});
|
||
|
||
$(document).on('show.bs.modal', '.modal', function () {
|
||
console.log("Modal is hidden");
|
||
});
|
||
|
||
$(document).ready(function() {
|
||
|
||
console.log('document ready start');
|
||
|
||
var memberWelcomeMailModal = new bootstrap.Modal(document.getElementById('member_welcome_mail_modal'));
|
||
var previewModal = new bootstrap.Modal(document.getElementById('preview_modal'));
|
||
|
||
|
||
document.getElementById('preview_modal').addEventListener('hidden.bs.modal', function () {
|
||
console.log('testing modal');
|
||
memberWelcomeMailModal.show();
|
||
console.log('testing modal end');
|
||
});
|
||
|
||
console.log('document ready end');
|
||
|
||
|
||
|
||
var toolbar = "bold,italic,strikethrough,|,superscript,subscript,|,align,";
|
||
const editorConfig = {
|
||
buttons: toolbar,
|
||
showPlaceholder: false,
|
||
toolbarButtonSize: 'small',
|
||
toolbarAdaptive: false,
|
||
saveHeightInStorage: true,
|
||
minHeight: 400,
|
||
extraButtons: [
|
||
{
|
||
name: 'info',
|
||
iconURL: '<?= base_url()."public"; ?>/assets/images/image-solid.svg', // Replace with the actual icon URL
|
||
exec: function (editor) {
|
||
const fileInput = document.getElementById("Question_title_fileInput");
|
||
fileInput.click();
|
||
},
|
||
},
|
||
],
|
||
};
|
||
|
||
const editor = Jodit.make("#member_welcome_mail_snow_editor", editorConfig);
|
||
|
||
const editor2 = Jodit.make("#member_reminder_mail_snow_editor", editorConfig);
|
||
|
||
|
||
const editor6 = Jodit.make("#member_ecard_mail_snow_editor", editorConfig);
|
||
|
||
const editor3 = Jodit.make("#member_review_and_summary", editorConfig);
|
||
|
||
|
||
const editor4 = Jodit.make("#account_maneger_summary_mail_snow_editor", editorConfig);
|
||
|
||
|
||
const editor5 = Jodit.make("#client_hr_summary", editorConfig);
|
||
|
||
document.addEventListener('change', function(event)
|
||
{
|
||
var target = event.target;
|
||
if (target.matches('#member_welcome_mail_customButton'))
|
||
{
|
||
editor.selection.insertHTML($(target).val());
|
||
$(target).val('');
|
||
}
|
||
else if (target.matches('#member_reminder_mail_modal_customButton'))
|
||
{
|
||
editor2.selection.insertHTML($(target).val());
|
||
$(target).val('');
|
||
}
|
||
else if (target.matches('#member_ecard_mail_modal_customButton'))
|
||
{
|
||
editor6.selection.insertHTML($(target).val());
|
||
$(target).val('');
|
||
}
|
||
else if (target.matches('#member_review_and_summary_mail_modal_customButton'))
|
||
{
|
||
editor3.selection.insertHTML($(target).val());
|
||
$(target).val('');
|
||
}
|
||
else if (target.matches('#account_maneger_summary_mail_modal_customButton'))
|
||
{
|
||
editor4.selection.insertHTML($(target).val());
|
||
$(target).val('');
|
||
}
|
||
else if (target.matches('#client_hr_summary_mail_modal_customButton'))
|
||
{
|
||
editor5.selection.insertHTML($(target).val());
|
||
$(target).val('');
|
||
}
|
||
});
|
||
|
||
$('.close').click(function ()
|
||
{
|
||
$(this).parent().parent().find('#subject').val('');
|
||
editor.setEditorValue('');
|
||
editor2.setEditorValue('');
|
||
editor3.setEditorValue('');
|
||
editor4.setEditorValue('');
|
||
editor5.setEditorValue('');
|
||
editor6.setEditorValue('');
|
||
|
||
})
|
||
|
||
const fileInput = document.getElementById("Question_title_fileInput");
|
||
|
||
fileInput.addEventListener("change", () => {
|
||
const file = fileInput.files[0];
|
||
if (file)
|
||
{
|
||
const reader = new FileReader();
|
||
reader.onload = function(e) {
|
||
const imageUrl = e.target.result;
|
||
editor.selection.insertImage(imageUrl);
|
||
};
|
||
reader.readAsDataURL(file);
|
||
}
|
||
fileInput.value = '';
|
||
});
|
||
|
||
$('#member_welcome_mail_form').submit(function (event)
|
||
{
|
||
event.preventDefault();
|
||
var joditEditor = editor;
|
||
if (joditEditor)
|
||
{
|
||
var mailContent = $(joditEditor.currentPlace.container).find('.jodit-wysiwyg').html();
|
||
var formData = $(this).serializeArray();
|
||
formData.push({ name: 'mailContent', value: mailContent });
|
||
formData.push({ name: 'client_id', value: $('#general_PrimaryKey').val() });
|
||
|
||
$('.loader').fadeIn();
|
||
$('.loader-mask').fadeIn();
|
||
var form_action = '<?= base_url("client/notification/create") ?>';
|
||
$.ajax({
|
||
url: form_action,
|
||
type: "POST",
|
||
data: formData,
|
||
dataType: 'json',
|
||
success: function(res)
|
||
{
|
||
$('#member_welcome_mail_modal').find('.close').click();
|
||
$('.loader').fadeOut();
|
||
$('.loader-mask').delay(350).fadeOut('slow');
|
||
},
|
||
error: function (xhr, status, error)
|
||
{
|
||
console.error(xhr.responseText);
|
||
console.error(status, error);
|
||
setTimeout(function()
|
||
{
|
||
$('.loader').fadeOut();
|
||
$('.loader-mask').delay(350).fadeOut('slow');
|
||
toastr.warning('Something Wrong!', 'warning');
|
||
}, 1000);
|
||
}
|
||
});
|
||
}
|
||
else
|
||
{
|
||
console.error("Jodit editor instance is not defined.");
|
||
}
|
||
})
|
||
|
||
$('#member_reminder_mail_form').submit(function (event)
|
||
{
|
||
event.preventDefault();
|
||
var joditEditor = editor2;
|
||
if (joditEditor) {
|
||
var mailContent = $(joditEditor.currentPlace.container).find('.jodit-wysiwyg').html();
|
||
var formData = $(this).serializeArray();
|
||
formData.push({ name: 'mailContent', value: mailContent });
|
||
formData.push({ name: 'client_id', value: $('#general_PrimaryKey').val() });
|
||
|
||
$('.loader').fadeIn();
|
||
$('.loader-mask').fadeIn();
|
||
var form_action = '<?= base_url("client/notification/create") ?>';
|
||
$.ajax({
|
||
url: form_action,
|
||
type: "POST",
|
||
data: formData,
|
||
dataType: 'json',
|
||
success: function(res)
|
||
{
|
||
console.log($('#member_reminder_mail_modal'));
|
||
$('#member_reminder_mail_modal').find('.close').click();
|
||
$('.loader').fadeOut();
|
||
$('.loader-mask').delay(350).fadeOut('slow');
|
||
},
|
||
error: function (xhr, status, error)
|
||
{
|
||
console.error(xhr.responseText);
|
||
console.error(status, error);
|
||
setTimeout(function()
|
||
{
|
||
$('.loader').fadeOut();
|
||
$('.loader-mask').delay(350).fadeOut('slow');
|
||
toastr.warning('Something Wrong!', 'warning');
|
||
}, 1000);
|
||
}
|
||
});
|
||
}
|
||
else
|
||
{
|
||
console.error("Jodit editor instance is not defined.");
|
||
}
|
||
})
|
||
|
||
$('#member_ecard_mail_form').submit(function (event)
|
||
{
|
||
event.preventDefault();
|
||
var joditEditor = editor6;
|
||
if (joditEditor) {
|
||
var mailContent = $(joditEditor.currentPlace.container).find('.jodit-wysiwyg').html();
|
||
var formData = $(this).serializeArray();
|
||
formData.push({ name: 'mailContent', value: mailContent });
|
||
formData.push({ name: 'client_id', value: $('#general_PrimaryKey').val() });
|
||
|
||
$('.loader').fadeIn();
|
||
$('.loader-mask').fadeIn();
|
||
var form_action = '<?= base_url("client/notification/create") ?>';
|
||
$.ajax({
|
||
url: form_action,
|
||
type: "POST",
|
||
data: formData,
|
||
dataType: 'json',
|
||
success: function(res)
|
||
{
|
||
$('#member_ecard_mail_modal').find('.close').click();
|
||
$('.loader').fadeOut();
|
||
$('.loader-mask').delay(350).fadeOut('slow');
|
||
},
|
||
error: function (xhr, status, error)
|
||
{
|
||
console.error(xhr.responseText);
|
||
console.error(status, error);
|
||
setTimeout(function()
|
||
{
|
||
$('.loader').fadeOut();
|
||
$('.loader-mask').delay(350).fadeOut('slow');
|
||
toastr.warning('Something Wrong!', 'warning');
|
||
}, 1000);
|
||
}
|
||
});
|
||
}
|
||
else
|
||
{
|
||
console.error("Jodit editor instance is not defined.");
|
||
}
|
||
})
|
||
|
||
$('#member_review_and_summary_mail_form').submit(function (event)
|
||
{
|
||
event.preventDefault();
|
||
var joditEditor = editor3;
|
||
if (joditEditor) {
|
||
var mailContent = $(joditEditor.currentPlace.container).find('.jodit-wysiwyg').html();
|
||
var formData = $(this).serializeArray();
|
||
formData.push({ name: 'mailContent', value: mailContent });
|
||
formData.push({ name: 'client_id', value: $('#general_PrimaryKey').val() });
|
||
|
||
$('.loader').fadeIn();
|
||
$('.loader-mask').fadeIn();
|
||
var form_action = '<?= base_url("client/notification/create") ?>';
|
||
$.ajax({
|
||
url: form_action,
|
||
type: "POST",
|
||
data: formData,
|
||
dataType: 'json',
|
||
success: function(res)
|
||
{
|
||
$('#member_review_and_summary_mail_modal').find('.close').click();
|
||
$('.loader').fadeOut();
|
||
$('.loader-mask').delay(350).fadeOut('slow');
|
||
},
|
||
error: function (xhr, status, error)
|
||
{
|
||
console.error(xhr.responseText);
|
||
console.error(status, error);
|
||
setTimeout(function()
|
||
{
|
||
$('.loader').fadeOut();
|
||
$('.loader-mask').delay(350).fadeOut('slow');
|
||
toastr.warning('Something Wrong!', 'warning');
|
||
}, 1000);
|
||
}
|
||
});
|
||
}
|
||
else
|
||
{
|
||
console.error("Jodit editor instance is not defined.");
|
||
}
|
||
})
|
||
|
||
$('#account_maneger_summary_mail_form').submit(function (event)
|
||
{
|
||
event.preventDefault();
|
||
var joditEditor = editor4;
|
||
if (joditEditor)
|
||
{
|
||
var mailContent = $(joditEditor.currentPlace.container).find('.jodit-wysiwyg').html();
|
||
var formData = $(this).serializeArray();
|
||
formData.push({ name: 'mailContent', value: mailContent });
|
||
formData.push({ name: 'client_id', value: $('#general_PrimaryKey').val() });
|
||
|
||
$('.loader').fadeIn();
|
||
$('.loader-mask').fadeIn();
|
||
var form_action = '<?= base_url("client/notification/create") ?>';
|
||
$.ajax({
|
||
url: form_action,
|
||
type: "POST",
|
||
data: formData,
|
||
dataType: 'json',
|
||
success: function(res)
|
||
{
|
||
$('#account_maneger_summary_mail_modal').find('.close').click();
|
||
$('.loader').fadeOut();
|
||
$('.loader-mask').delay(350).fadeOut('slow');
|
||
},
|
||
error: function (xhr, status, error)
|
||
{
|
||
console.error(xhr.responseText);
|
||
console.error(status, error);
|
||
setTimeout(function()
|
||
{
|
||
$('.loader').fadeOut();
|
||
$('.loader-mask').delay(350).fadeOut('slow');
|
||
toastr.warning('Something Wrong!', 'warning');
|
||
}, 1000);
|
||
}
|
||
});
|
||
}
|
||
else
|
||
{
|
||
console.error("Jodit editor instance is not defined.");
|
||
}
|
||
})
|
||
|
||
$('#client_hr_summary_mail_form').submit(function (event)
|
||
{
|
||
event.preventDefault();
|
||
var joditEditor = editor5;
|
||
if (joditEditor)
|
||
{
|
||
var mailContent = $(joditEditor.currentPlace.container).find('.jodit-wysiwyg').html();
|
||
var formData = $(this).serializeArray();
|
||
formData.push({ name: 'mailContent', value: mailContent });
|
||
formData.push({ name: 'client_id', value: $('#general_PrimaryKey').val() });
|
||
|
||
$('.loader').fadeIn();
|
||
$('.loader-mask').fadeIn();
|
||
var form_action = '<?= base_url("client/notification/create") ?>';
|
||
$.ajax({
|
||
url: form_action,
|
||
type: "POST",
|
||
data: formData,
|
||
dataType: 'json',
|
||
success: function(res)
|
||
{
|
||
$('#client_hr_summary_mail_modal').find('.close').click();
|
||
$('.loader').fadeOut();
|
||
$('.loader-mask').delay(350).fadeOut('slow');
|
||
},
|
||
error: function (xhr, status, error)
|
||
{
|
||
console.error(xhr.responseText);
|
||
console.error(status, error);
|
||
setTimeout(function()
|
||
{
|
||
$('.loader').fadeOut();
|
||
$('.loader-mask').delay(350).fadeOut('slow');
|
||
toastr.warning('Something Wrong!', 'warning');
|
||
}, 1000);
|
||
}
|
||
});
|
||
}
|
||
else
|
||
{
|
||
console.error("Jodit editor instance is not defined.");
|
||
}
|
||
})
|
||
|
||
$(document).on('click', '#notification_enable_form_submit', function()
|
||
{
|
||
var formData = [];
|
||
console.log($('#hr_mail_id').val());
|
||
|
||
formData.push({name:'client_id', value: $('#general_PrimaryKey').val()})
|
||
formData.push({ name: 'nhance_team_mail_ids', value: $('#nhance_team_mail_ids').val() });
|
||
formData.push({ name: 'hr_mail_id', value: $('#hr_mail_id').val() });
|
||
formData.push({ name: 'mail_domain', value: $('#mail_domain').val() });
|
||
formData.push({ name: 'reply_to', value: $('#reply_to').val() });
|
||
formData.push({ name: 'member_welcome_mail_btn', value: $('#member_welcome_mail_btn').prop('checked') });
|
||
formData.push({ name: 'member_reminder_mail_btn', value: $('#member_reminder_mail_btn').prop('checked') });
|
||
formData.push({ name: 'member_ecard_mail_btn', value: $('#member_ecard_mail_btn').prop('checked') });
|
||
formData.push({ name: 'member_review_and_summary_mail_btn', value: $('#member_review_and_summary_mail_btn').prop('checked') });
|
||
formData.push({ name: 'account_maneger_summary_mail_btn', value: $('#account_maneger_summary_mail_btn').prop('checked') });
|
||
formData.push({ name: 'client_hr_summary_mail_btn', value: $('#client_hr_summary_mail_btn').prop('checked') });
|
||
|
||
var form_action = '<?= base_url("client/notification/update_enable") ?>';
|
||
$('.loader').fadeIn();
|
||
$('.loader-mask').fadeIn();
|
||
$.ajax({
|
||
url: form_action,
|
||
type: "POST",
|
||
data: formData,
|
||
dataType: 'json',
|
||
success: function(res)
|
||
{
|
||
console.log(res);
|
||
if (res)
|
||
{
|
||
toastr.success('Update Successfully');
|
||
}
|
||
$('.loader').fadeOut();
|
||
$('.loader-mask').delay(350).fadeOut('slow');
|
||
},
|
||
error: function (xhr, status, error)
|
||
{
|
||
console.error(xhr.responseText);
|
||
console.error(status, error);
|
||
setTimeout(function()
|
||
{
|
||
$('.loader').fadeOut();
|
||
$('.loader-mask').delay(350).fadeOut('slow');
|
||
toastr.warning('Something Wrong!', 'warning');
|
||
}, 1000);
|
||
}
|
||
});
|
||
})
|
||
});
|
||
|
||
if ($('#myDropdown')[0]) {
|
||
document.getElementById("myDropdown").addEventListener("click", function(event)
|
||
{
|
||
// Check if the clicked element is a dropdown item
|
||
if (event.target.classList.contains("dropdown-item"))
|
||
{
|
||
const selectedValue = event.target.innerText;
|
||
const editor = Jodit.instances["member_reminder_mail_snow_editor"];
|
||
editor.selection.insertHTML(selectedValue);
|
||
}
|
||
});
|
||
}
|
||
|
||
function snakeCaseToCamelCase(input)
|
||
{
|
||
return input.split('_').map(function(word, index)
|
||
{
|
||
return word.charAt(0).toUpperCase() + word.slice(1);
|
||
}).join(' ');
|
||
}
|
||
|
||
function getMailTemplateData(element)
|
||
{
|
||
var template_name = $(element).attr('id');
|
||
|
||
if (template_name == "member_welcome_mail" || template_name == "member_reminder_mail" || template_name == "member_ecard_mail" || template_name == "member_review_and_summary_mail" || template_name == "account_maneger_summary_mail" || template_name == "client_hr_summary_mail")
|
||
{
|
||
$('.loader').fadeIn();
|
||
$('.loader-mask').fadeIn();
|
||
|
||
var form_action = '<?= base_url("client/notification/getMailTemplateData/") ?>'+template_name+ '/' + $('#general_PrimaryKey').val();
|
||
|
||
$.ajax({
|
||
url: form_action,
|
||
type: "GET",
|
||
dataType: 'json',
|
||
success: function(res) {
|
||
console.log('get Mail Template Data', res);
|
||
if (res)
|
||
{
|
||
$(`#${template_name}_form`).find('#template_name').val(snakeCaseToCamelCase(res.template_name));
|
||
$(`#${template_name}_form`).find('#subject').val(res.subject);
|
||
$(`#${template_name}_form`).find('.jodit-wysiwyg').html(res.mail_content);
|
||
|
||
console.log(res.id)
|
||
|
||
if(res.id){
|
||
$('.testmail').show();
|
||
$('.setid').attr('data-id', res.id);
|
||
}else{
|
||
$('.testmail').hide();
|
||
$('.setid').attr('data-id', '');
|
||
|
||
}
|
||
|
||
}else{
|
||
$('.testmail').hide();
|
||
$('.setid').attr('data-id', '');
|
||
|
||
}
|
||
$('.loader').fadeOut();
|
||
$('.loader-mask').delay(350).fadeOut('slow');
|
||
},
|
||
error: function (xhr, status, error) {
|
||
console.error(xhr.responseText);
|
||
console.error(status, error);
|
||
setTimeout(function() {
|
||
$('.loader').fadeOut();
|
||
$('.loader-mask').delay(350).fadeOut('slow');
|
||
toastr.warning('Something Wrong!', 'warning');
|
||
}, 1000);
|
||
}
|
||
});
|
||
}
|
||
}
|
||
|
||
function testMailSend(input){
|
||
|
||
// var memberWelcomeMailModal = new bootstrap.Modal(document.getElementById('member_welcome_mail_modal'));
|
||
// var previewModal = new bootstrap.Modal(document.getElementById('preview_modal'));
|
||
// previewModal.show();
|
||
// $('.close').click();
|
||
|
||
// Swal.fire({
|
||
// title: "Enter Testing mail",
|
||
// input: "text",
|
||
// inputPlaceholder: "Enter your email",
|
||
// showCancelButton: true,
|
||
// confirmButtonText: "Submit",
|
||
// backdrop: 'static', // Prevent focus issue by disallowing clicking outside
|
||
// preConfirm: (inputValue) => {
|
||
// if (!inputValue) {
|
||
// Swal.showValidationMessage('Please enter a valid email');
|
||
// }
|
||
// return inputValue;
|
||
// }
|
||
// }).then((result) => {
|
||
// if (result.isConfirmed) {
|
||
// Swal.fire({
|
||
// title: `Entered Email: ${result.value}`,
|
||
// text: 'This is the email you entered.',
|
||
// icon: 'success'
|
||
// });
|
||
// }
|
||
// });
|
||
// return false;
|
||
|
||
let test_mail = prompt("Please enter test mail:");
|
||
console.log('mail address:', test_mail);
|
||
|
||
if (test_mail !== null || test_mail !== "") {
|
||
|
||
if(isValidEmail(test_mail)){
|
||
|
||
var template_id = $(input).data('id');
|
||
console.log('templte id', template_id);
|
||
|
||
if(template_id){
|
||
let url = '<?= base_url('util/sentTestMail/') ?>' + template_id + '/' + test_mail;
|
||
console.log('testing mail url:', url);
|
||
|
||
$('.loader').fadeIn();
|
||
$('.loader-mask').fadeIn();
|
||
|
||
$.ajax({
|
||
url: url,
|
||
type: "GET",
|
||
dataType: 'json',
|
||
success: function (res) {
|
||
|
||
console.log('Test mail send function response', res)
|
||
|
||
$('.loader').fadeOut();
|
||
$('.loader-mask').delay(350).fadeOut('slow');
|
||
|
||
if(res.status == true){
|
||
|
||
let respond = res.respond;
|
||
console.log('Parsed respond', respond)
|
||
|
||
if(respond.status == 'success'){
|
||
toastr.success(respond.message, 'SUCCESS')
|
||
}else{
|
||
toastr.warning(respond.message, 'WARNING')
|
||
}
|
||
|
||
}else{
|
||
toastr.warning('Failed to sent mail', 'WARNING')
|
||
}
|
||
},
|
||
error: function (xhr, status, error) {
|
||
|
||
$('.loader').fadeOut();
|
||
$('.loader-mask').delay(350).fadeOut('slow');
|
||
|
||
console.error(xhr.responseText);
|
||
console.error(status, error);
|
||
}
|
||
});
|
||
|
||
}else{
|
||
let alert_msg = 'Template ID not exist'
|
||
toastr.warning(alert_msg, 'WARNING');
|
||
}
|
||
|
||
}else{
|
||
toastr.warning('Please enter the valid mail', 'WARNING');
|
||
}
|
||
|
||
}else{
|
||
|
||
toastr.warning('Please enter the valid mail', 'WARNING');
|
||
}
|
||
|
||
}
|
||
|
||
function isValidEmail(email) {
|
||
const emailPattern = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
||
return emailPattern.test(email);
|
||
}
|
||
|
||
</script>
|