c
This commit is contained in:
@@ -2,6 +2,8 @@
|
|||||||
require_once('.hta_config/crm_config.php');
|
require_once('.hta_config/crm_config.php');
|
||||||
require_once('.htac_header.php');
|
require_once('.htac_header.php');
|
||||||
require_once('.htac_nav.php');
|
require_once('.htac_nav.php');
|
||||||
|
|
||||||
|
$getLeadID = $_GET['id'];
|
||||||
// echo $_GET['id'];
|
// echo $_GET['id'];
|
||||||
// Below two fetch for edit data
|
// Below two fetch for edit data
|
||||||
|
|
||||||
@@ -49,6 +51,8 @@
|
|||||||
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
// var_dump($rows);
|
// var_dump($rows);
|
||||||
foreach($rows as $row){
|
foreach($rows as $row){
|
||||||
|
$usersNameforSendMessage = $row['name'];
|
||||||
|
$usersNumberforSendMessage = $row['phone'];
|
||||||
$nameParts = explode(" ", $row['name']);
|
$nameParts = explode(" ", $row['name']);
|
||||||
$firstInitial = substr($nameParts[0], 0, 1);
|
$firstInitial = substr($nameParts[0], 0, 1);
|
||||||
$lastInitial = isset($nameParts[1]) ? substr($nameParts[1], 0, 1) : '';
|
$lastInitial = isset($nameParts[1]) ? substr($nameParts[1], 0, 1) : '';
|
||||||
@@ -115,71 +119,12 @@
|
|||||||
</select>
|
</select>
|
||||||
<div class="xzmdropdown-wrapper ">
|
<div class="xzmdropdown-wrapper ">
|
||||||
<button class="xzmdropdown-btn"><i class="fa fa-envelope" style="font-size: 20px"></i></button>
|
<button class="xzmdropdown-btn"><i class="fa fa-envelope" style="font-size: 20px"></i></button>
|
||||||
<div id="templateList" class="xzmdropdown-content">
|
<div id="templateList" class="xzmdropdown-content"></div>
|
||||||
</div>
|
|
||||||
</div> |
|
</div> |
|
||||||
<div>
|
<div>
|
||||||
<div class="xzmdropdown-wrapper ">
|
<div class="xzmdropdown-wrapper ">
|
||||||
<button class="xzmdropdown-btn px-4"><i class="fab fa-whatsapp" style="font-size: 20px"></i></button>
|
<button class="xzmdropdown-btn px-4"><i class="fab fa-whatsapp" style="font-size: 20px"></i></button>
|
||||||
<div class="xzmdropdown-content">
|
<div id="templateWhatsappList" class="xzmdropdown-content"></div>
|
||||||
<form method="post">
|
|
||||||
<input type="hidden" name="leadid" value="<?php echo $_GET['id'] ?>" />
|
|
||||||
<input type="hidden" name="useremail" value="<?php echo $_SESSION['email'] ?>" />
|
|
||||||
<input type="hidden" name="templateid" value="" />
|
|
||||||
<input type="submit" value="UNO">
|
|
||||||
</form>
|
|
||||||
<!-- <a href="#">UNO</a> -->
|
|
||||||
|
|
||||||
<form method="post">
|
|
||||||
<input type="hidden" name="leadid" value="<?php echo $_GET['id'] ?>" />
|
|
||||||
<input type="hidden" name="useremail" value="<?php echo $_SESSION['email'] ?>" />
|
|
||||||
<input type="hidden" name="templateid" value="" />
|
|
||||||
<input type="submit" value="Primero">
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<!-- <a href="#">Primero</a> -->
|
|
||||||
<div class="xzmdropdown-item">
|
|
||||||
<form method="post">
|
|
||||||
<input type="hidden" name="leadid" value="<?php echo $_GET['id'] ?>" />
|
|
||||||
<input type="hidden" name="useremail" value="<?php echo $_SESSION['email'] ?>" />
|
|
||||||
<input type="hidden" name="templateid" value="" />
|
|
||||||
<input type="submit" value="ILC">
|
|
||||||
</form>
|
|
||||||
<!-- <a href="#">ILC</a> -->
|
|
||||||
|
|
||||||
<form method="post">
|
|
||||||
<input type="hidden" name="leadid" value="<?php echo $_GET['id'] ?>" />
|
|
||||||
<input type="hidden" name="useremail" value="<?php echo $_SESSION['email'] ?>" />
|
|
||||||
<input type="hidden" name="templateid" value="" />
|
|
||||||
<input type="submit" value="Complete package">
|
|
||||||
</form>
|
|
||||||
<!-- <a href="#">Complete package</a> -->
|
|
||||||
<a href="#" class="bespoke-trigger">Bespoke</a>
|
|
||||||
<div class="xzmdropdown-submenu">
|
|
||||||
<form method="post">
|
|
||||||
<input type="hidden" name="leadid" value="<?php echo $_GET['id'] ?>" />
|
|
||||||
<input type="hidden" name="useremail" value="<?php echo $_SESSION['email'] ?>" />
|
|
||||||
<input type="hidden" name="templateid" value="" />
|
|
||||||
<input type="submit" value="Academic">
|
|
||||||
</form>
|
|
||||||
<!-- <a href="#">Academic</a> -->
|
|
||||||
<form method="post">
|
|
||||||
<input type="hidden" name="leadid" value="<?php echo $_GET['id'] ?>" />
|
|
||||||
<input type="hidden" name="useremail" value="<?php echo $_SESSION['email'] ?>" />
|
|
||||||
<input type="hidden" name="templateid" value="" />
|
|
||||||
<input type="submit" value="Buzzapp">
|
|
||||||
</form>
|
|
||||||
<!-- <a href="#">Buzzapp</a> -->
|
|
||||||
<form method="post">
|
|
||||||
<input type="hidden" name="leadid" value="<?php echo $_GET['id'] ?>" />
|
|
||||||
<input type="hidden" name="useremail" value="<?php echo $_SESSION['email'] ?>" />
|
|
||||||
<input type="hidden" name="templateid" value="" />
|
|
||||||
<input type="submit" value="Design Solution">
|
|
||||||
</form>
|
|
||||||
<!-- <a href="#">Design Solution</a> -->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -529,6 +474,48 @@
|
|||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="flex flex-col mt-3 bg-[#F6F6F6] rounded-xl">
|
||||||
|
<div class="flex flex-row place-content-between p-3" style="border-bottom: 2px solid #7E8299; border-style: dashed;">
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<p style="font-size: 20px; font-weight: bold;">Communication:</p>
|
||||||
|
<p><?php echo $saved_message; ?></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="" style="max-height: 265px; overflow-y: auto;">
|
||||||
|
<?php
|
||||||
|
try {
|
||||||
|
$conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
|
||||||
|
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||||
|
$stmt = $conn->prepare("SELECT * FROM communication WHERE leadid = :leadid ORDER BY time DESC");
|
||||||
|
$stmt->bindParam(':leadid', $_GET['id']);
|
||||||
|
$stmt->execute();
|
||||||
|
$appt_data = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
$appt_rowCount = count($appt_data);
|
||||||
|
|
||||||
|
foreach ($appt_data as $appt) {
|
||||||
|
// Assuming 'comment' and 'date' fields are in the appointments table
|
||||||
|
$apptDate = explode(' ', $appt['time']); // Split date and time
|
||||||
|
?>
|
||||||
|
<div class="flex flex-col px-6" style="border-bottom: 2px solid #D9D9D9;">
|
||||||
|
<div class="flex flex-row place-content-between align-items-center">
|
||||||
|
<p style="font-size: 15px; font-weight: bold;"><?php echo $appt['templateid']; ?></p>
|
||||||
|
</div>
|
||||||
|
<div class="grid grid-cols-2">
|
||||||
|
<p class="text-[#7E8299] ">Mail Send by <?php echo $appt['username']; ?></p>
|
||||||
|
<div class="flex flex-col" style="border-left: 3px solid #7875F4;">
|
||||||
|
<p style="font-weight: bold; padding-left: 6px;"><?php echo $apptDate[0]; ?></p>
|
||||||
|
<p style="padding-left: 6px;"><?php echo $apptDate[1]; ?></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
echo "<p class='text-danger'>Error: " . $e->getMessage() . "</p>";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<!-- This IS Right Side DIV -->
|
<!-- This IS Right Side DIV -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -556,78 +543,195 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
<?php
|
||||||
|
if(isset($_GET['send-whatsapp-id']) && $_GET['send-whatsapp-id']){
|
||||||
|
$templateID = $_GET['send-whatsapp-id'];
|
||||||
|
$usersNumberforSendMessagex = '917001601485';
|
||||||
|
// echo $usersNameforSendMessage;
|
||||||
|
// $usersNames = $usersNameforSendMessage;
|
||||||
|
|
||||||
|
$url = "https://api.interakt.ai/v1/public/message/";
|
||||||
|
$apiKey = 'Basic {{OTgyajd4bHFUSXItSW9PN1BTdzhOenNDaS0ya0NQeXByRE0tMnRyQ3FrUTo=}}';
|
||||||
|
$data = [
|
||||||
|
"fullPhoneNumber" => $usersNumberforSendMessagex,
|
||||||
|
"callbackData" => "some text here",
|
||||||
|
"type" => "Template",
|
||||||
|
"template" => [
|
||||||
|
"name" => "boost_conversion",
|
||||||
|
"languageCode" => "en",
|
||||||
|
"headerValues" => [
|
||||||
|
"header_variable_value"
|
||||||
|
],
|
||||||
|
"bodyValues" => [
|
||||||
|
$usersNameforSendMessage
|
||||||
|
]
|
||||||
|
]
|
||||||
|
];
|
||||||
|
$jsonData = json_encode($data);
|
||||||
|
|
||||||
|
$options = [
|
||||||
|
'http' => [
|
||||||
|
'header' => "Content-Type: application/json\r\n" .
|
||||||
|
"Authorization: $apiKey\r\n" .
|
||||||
|
"Content-Length: " . strlen($jsonData) . "\r\n",
|
||||||
|
'method' => 'POST',
|
||||||
|
'content' => $jsonData,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
$context = stream_context_create($options);
|
||||||
|
$fp = fopen($url, 'r', false, $context);
|
||||||
|
|
||||||
|
// Check for errors
|
||||||
|
if ($fp === FALSE) {
|
||||||
|
echo 'Error occurred';
|
||||||
|
} else {
|
||||||
|
// Read the response
|
||||||
|
$response = stream_get_contents($fp);
|
||||||
|
|
||||||
|
if ($response === FALSE) {
|
||||||
|
echo 'Error reading response';
|
||||||
|
} else {
|
||||||
|
// Print the response
|
||||||
|
if(isset($_GET['send-whatsapp-id'])){
|
||||||
|
$templateName = $_GET['send-whatsapp-id'];
|
||||||
|
} elseif(isset($_GET['send-email-id'])){
|
||||||
|
$templateName = $_GET['send-email-id'];
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
$stmt = $conn->prepare("INSERT INTO communication (leadid, useremail, username, templateid) VALUES (:leadid, :useremail, :username, :templateid)");
|
||||||
|
$stmt->bindParam(':leadid', $_GET['id']);
|
||||||
|
$stmt->bindParam(':useremail', $_SESSION['email']);
|
||||||
|
$stmt->bindParam(':username', $_SESSION['name']);
|
||||||
|
$stmt->bindParam(':templateid', $templateName);
|
||||||
|
$stmt->execute();
|
||||||
|
echo "Message Sent successfully";
|
||||||
|
} catch(PDOException $e) {
|
||||||
|
echo "Error: " . $e->getMessage();
|
||||||
|
}
|
||||||
|
// echo '<script>window.location.href="/edit-lead/?id='.$_GET['id'].'"</script>';
|
||||||
|
// echo $response;
|
||||||
|
}
|
||||||
|
// Close the file pointer
|
||||||
|
fclose($fp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function changeBvValue(){
|
function changeBvValue(){
|
||||||
let verticalsDropDown = document.getElementById('businessVerticals');
|
let verticalsDropDown = document.getElementById('businessVerticals');
|
||||||
let bvValue = verticalsDropDown.value;
|
let bvValue = verticalsDropDown.value;
|
||||||
let atheneumData = [
|
|
||||||
{templateName: "Welcome mail", templateID: "33", verticals: "atheneum"},
|
|
||||||
{templateName: "Introduction mail", templateID: "5", verticals: "atheneum"},
|
|
||||||
{templateName: "DNP", templateID: "21", verticals: "atheneum"},
|
|
||||||
{templateName: "MTT", templateID: "16", verticals: "atheneum"},
|
|
||||||
{templateName: "SEN", templateID: "22", verticals: "atheneum"},
|
|
||||||
{templateName: "PPTTC", templateID: "20", verticals: "atheneum"},
|
|
||||||
{templateName: "NTT", templateID: "19", verticals: "atheneum"},
|
|
||||||
{templateName: "CDA", templateID: "24", verticals: "atheneum"},
|
|
||||||
{templateName: "TEFL", templateID: "26", verticals: "atheneum"},
|
|
||||||
{templateName: "TESOL LEVEL 7", templateID: "25", verticals: "atheneum"},
|
|
||||||
{templateName: "TESOL", templateID: "30", verticals: "atheneum"},
|
|
||||||
{templateName: "ECCE", templateID: "27", verticals: "atheneum"},
|
|
||||||
{templateName: "Education administration & management", templateID: "30", verticals: "atheneum"},
|
|
||||||
{templateName: "10% OFF", templateID: "34", verticals: "atheneum"},
|
|
||||||
{templateName: "15% OFF", templateID: "36", verticals: "atheneum"}
|
|
||||||
];
|
|
||||||
let teenybeansData = [
|
|
||||||
{templateName: "UNO", templateID: "19", verticals: "teenybeans"},
|
|
||||||
{templateName: "PRIMERO", templateID: "17", verticals: "teenybeans"},
|
|
||||||
{templateName: "ILC", templateID: "27", verticals: "teenybeans"},
|
|
||||||
{templateName: "Complete Package", templateID: "28", verticals: "teenybeans"},
|
|
||||||
{templateName: "Bespoke- Marketing solution", templateID: "32", verticals: "teenybeans"},
|
|
||||||
{templateName: "Bespoke- Design solution", templateID: "31", verticals: "teenybeans"},
|
|
||||||
{templateName: "Bespoke- Academic solution", templateID: "30", verticals: "teenybeans"}
|
|
||||||
];
|
|
||||||
let iimttData = [
|
|
||||||
{templateName: "B2B- Introduction", templateID: "25", verticals: "iimtt"},
|
|
||||||
{templateName: "B2B- Followup", templateID: "18", verticals: "iimtt"},
|
|
||||||
{templateName: "B2C- Introduction", templateID: "22", verticals: "iimtt"},
|
|
||||||
{templateName: "B2C-Followup", templateID: "23", verticals: "iimtt"},
|
|
||||||
];
|
|
||||||
let bipData = [
|
|
||||||
{templateName: "Introduction", templateID: "24", verticals: "bip"},
|
|
||||||
{templateName: "School visit invitation", templateID: "26", verticals: "bip"}
|
|
||||||
];
|
|
||||||
let buzzappData = [
|
|
||||||
{templateName: "Introduction", templateID: "20", verticals: "buzzapp"},
|
|
||||||
{templateName: "Follow up", templateID: "29", verticals: "buzzapp"}
|
|
||||||
];
|
|
||||||
|
|
||||||
let templateList = document.getElementById('templateList');
|
let atheneumWhatsAppData = [
|
||||||
templateList.innerHTML = ''; // Clear the previous list items
|
{templateName : "AG_Welcome",templateID : "boost_conversion_gn",verticals : "atheneum"},
|
||||||
|
{templateName : "AG_introduction", templateID : "boost_conversion", verticals : "atheneum"},
|
||||||
|
{templateName : "AG_DNP", templateID : "may_offer_tb", verticals : "atheneum"}
|
||||||
|
];
|
||||||
|
|
||||||
let selectedData;
|
let teenybeansWhatsAppData = [
|
||||||
if (bvValue === 'atheneum') {
|
{templateName : "Introduction_TEENY Beans",templateID : "boost_conversion_gn",verticals : "teenybeans"},
|
||||||
selectedData = atheneumData;
|
{templateName : "TB_DNP", templateID : "boost_conversion", verticals : "teenybeans"},
|
||||||
} else if (bvValue === 'teenybeans') {
|
{templateName : "TB_UNO", templateID : "may_offer_tb", verticals : "teenybeans"}
|
||||||
selectedData = teenybeansData;
|
];
|
||||||
} else if(bvValue === 'iimtt') {
|
let buzzappWhatsAppData = [
|
||||||
selectedData = iimttData;
|
{templateName : "crm_buzzapp_Introduction",templateID : "boost_conversion_gn",verticals : "buzzapp"},
|
||||||
} else if(bvValue === 'buzzapp') {
|
{templateName : "Buzzapp_crm_followup", templateID : "boost_conversion", verticals : "buzzapp"}
|
||||||
selectedData = buzzappData;
|
];
|
||||||
} else if(bvValue === 'bip') {
|
let iimttWhatsAppData = [
|
||||||
selectedData = bipData;
|
{templateName : "IIMTT_B2B Introduction New",templateID : "boost_conversion_gn",verticals : "iimtt"},
|
||||||
} else {
|
{templateName : "IIMTT_B2B_Followup", templateID : "boost_conversion", verticals : "iimtt"},
|
||||||
selectedData = []; // No data for other selections, you can add more datasets as needed
|
{templateName : "IIMTT_B2C Introduction New", templateID : "boost_conversion", verticals : "iimtt"},
|
||||||
}
|
{templateName : "IIMTT_B2C Followup", templateID : "boost_conversion", verticals : "iimtt"}
|
||||||
|
];
|
||||||
|
let bipWhatsAppData = [
|
||||||
|
{templateName : "crm_bip__introduction",templateID : "boost_conversion_gn",verticals : "bip"},
|
||||||
|
{templateName : "crm_bip_school visit invitation", templateID : "boost_conversion", verticals : "bip"}
|
||||||
|
];
|
||||||
|
|
||||||
selectedData.forEach(data => {
|
let atheneumData = [
|
||||||
const anchorLink = document.createElement('a');
|
{templateName: "Welcome mail", templateID: "33", verticals: "atheneum"},
|
||||||
anchorLink.text = data.templateName;
|
{templateName: "Introduction mail", templateID: "5", verticals: "atheneum"},
|
||||||
anchorLink.href = `?send-email-id=${data.templateID}`;
|
{templateName: "DNP", templateID: "21", verticals: "atheneum"},
|
||||||
templateList.appendChild(anchorLink);
|
{templateName: "MTT", templateID: "16", verticals: "atheneum"},
|
||||||
});
|
{templateName: "SEN", templateID: "22", verticals: "atheneum"},
|
||||||
|
{templateName: "PPTTC", templateID: "20", verticals: "atheneum"},
|
||||||
|
{templateName: "NTT", templateID: "19", verticals: "atheneum"},
|
||||||
|
{templateName: "CDA", templateID: "24", verticals: "atheneum"},
|
||||||
|
{templateName: "TEFL", templateID: "26", verticals: "atheneum"},
|
||||||
|
{templateName: "TESOL LEVEL 7", templateID: "25", verticals: "atheneum"},
|
||||||
|
{templateName: "TESOL", templateID: "30", verticals: "atheneum"},
|
||||||
|
{templateName: "ECCE", templateID: "27", verticals: "atheneum"},
|
||||||
|
{templateName: "Education administration & management", templateID: "30", verticals: "atheneum"},
|
||||||
|
{templateName: "10% OFF", templateID: "34", verticals: "atheneum"},
|
||||||
|
{templateName: "15% OFF", templateID: "36", verticals: "atheneum"}
|
||||||
|
];
|
||||||
|
let teenybeansData = [
|
||||||
|
{templateName: "UNO", templateID: "19", verticals: "teenybeans"},
|
||||||
|
{templateName: "PRIMERO", templateID: "17", verticals: "teenybeans"},
|
||||||
|
{templateName: "ILC", templateID: "27", verticals: "teenybeans"},
|
||||||
|
{templateName: "Complete Package", templateID: "28", verticals: "teenybeans"},
|
||||||
|
{templateName: "Bespoke- Marketing solution", templateID: "32", verticals: "teenybeans"},
|
||||||
|
{templateName: "Bespoke- Design solution", templateID: "31", verticals: "teenybeans"},
|
||||||
|
{templateName: "Bespoke- Academic solution", templateID: "30", verticals: "teenybeans"}
|
||||||
|
];
|
||||||
|
let iimttData = [
|
||||||
|
{templateName: "B2B- Introduction", templateID: "25", verticals: "iimtt"},
|
||||||
|
{templateName: "B2B- Followup", templateID: "18", verticals: "iimtt"},
|
||||||
|
{templateName: "B2C- Introduction", templateID: "22", verticals: "iimtt"},
|
||||||
|
{templateName: "B2C-Followup", templateID: "23", verticals: "iimtt"},
|
||||||
|
];
|
||||||
|
let bipData = [
|
||||||
|
{templateName: "Introduction", templateID: "24", verticals: "bip"},
|
||||||
|
{templateName: "School visit invitation", templateID: "26", verticals: "bip"}
|
||||||
|
];
|
||||||
|
let buzzappData = [
|
||||||
|
{templateName: "Introduction", templateID: "20", verticals: "buzzapp"},
|
||||||
|
{templateName: "Follow up", templateID: "29", verticals: "buzzapp"}
|
||||||
|
];
|
||||||
|
|
||||||
|
let templateWhatsappList = document.getElementById('templateWhatsappList');
|
||||||
|
templateWhatsappList.innerHTML = ''; // Clear the previous list items
|
||||||
|
|
||||||
|
let templateList = document.getElementById('templateList');
|
||||||
|
templateList.innerHTML = ''; // Clear the previous list items
|
||||||
|
|
||||||
|
let selectedData;
|
||||||
|
let whatsAppSelectdeData;
|
||||||
|
if (bvValue === 'atheneum') {
|
||||||
|
selectedData = atheneumData;
|
||||||
|
whatsAppSelectdeData = atheneumWhatsAppData;
|
||||||
|
} else if (bvValue === 'teenybeans') {
|
||||||
|
selectedData = teenybeansData;
|
||||||
|
whatsAppSelectdeData = teenybeansWhatsAppData;
|
||||||
|
} else if(bvValue === 'iimtt') {
|
||||||
|
selectedData = iimttData;
|
||||||
|
whatsAppSelectdeData = iimttWhatsAppData;
|
||||||
|
} else if(bvValue === 'buzzapp') {
|
||||||
|
selectedData = buzzappData;
|
||||||
|
whatsAppSelectdeData = buzzappWhatsAppData;
|
||||||
|
} else if(bvValue === 'bip') {
|
||||||
|
selectedData = bipData;
|
||||||
|
whatsAppSelectdeData = bipWhatsAppData;
|
||||||
|
} else {
|
||||||
|
selectedData = []; // No data for other selections, you can add more datasets as needed
|
||||||
|
whatsAppSelectdeData = []; // No data for other selections, you can add more datasets as needed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
selectedData.forEach(data => {
|
||||||
|
const anchorLink = document.createElement('a');
|
||||||
|
anchorLink.text = data.templateName;
|
||||||
|
anchorLink.href = `?id=<?php echo $getLeadID ?>&send-email-id=${data.templateID}`;
|
||||||
|
templateList.appendChild(anchorLink);
|
||||||
|
});
|
||||||
|
whatsAppSelectdeData.forEach(data => {
|
||||||
|
const anchorLink = document.createElement('a');
|
||||||
|
anchorLink.text = data.templateName;
|
||||||
|
anchorLink.href = `?id=<?php echo $getLeadID ?>&send-whatsapp-id=${data.templateID}`;
|
||||||
|
templateWhatsappList.appendChild(anchorLink);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
const copyButtons = document.querySelectorAll('.copy-btn');
|
const copyButtons = document.querySelectorAll('.copy-btn');
|
||||||
|
|
||||||
@@ -717,6 +821,41 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// function senWhatsapp() {
|
||||||
|
// fetch('https://api.interakt.ai/v1/public/message/', {
|
||||||
|
// method: 'POST',
|
||||||
|
// headers: {
|
||||||
|
// 'Content-Type': 'application/json',
|
||||||
|
// 'Authorization': 'Basic {{OTgyajd4bHFUSXItSW9PN1BTdzhOenNDaS0ya0NQeXByRE0tMnRyQ3FrUTo=}}'
|
||||||
|
// },
|
||||||
|
// body: JSON.stringify({
|
||||||
|
// "countryCode": "+91",
|
||||||
|
// "phoneNumber": "8343820536",
|
||||||
|
// "callbackData": "some text here",
|
||||||
|
// "type": "Template",
|
||||||
|
// "template": {
|
||||||
|
// "name": "boost_conversion",
|
||||||
|
// "languageCode": "en",
|
||||||
|
// "headerValues": [
|
||||||
|
// "header_variable_value"
|
||||||
|
// ],
|
||||||
|
// "bodyValues": [
|
||||||
|
// "body_variable_value_1"
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// .then(response => response.json())
|
||||||
|
// .then(data => {
|
||||||
|
// console.log('Success:', data);
|
||||||
|
// })
|
||||||
|
// .catch((error) => {
|
||||||
|
// console.error('Error:', error);
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
// fetchCountries();
|
// fetchCountries();
|
||||||
let nameID = document.getElementById('name');
|
let nameID = document.getElementById('name');
|
||||||
let addressID = document.getElementById('address');
|
let addressID = document.getElementById('address');
|
||||||
|
|||||||
Reference in New Issue
Block a user