Live Helper Chat support forum.. Forum is locked. New place for questions - Github Discussions
You are not logged in.
Pages: 1
I have installed latest version of Livehelperchat, and I have created a bot trigger which will ask user for his email address and then "execute javascript" trigger to check if the email address exist or not. I want to fire two difference triggers "Email Address Not Found" OR "Email Address Found" based on email address found or not. But I couldn't find any way to trigger these based on separate response.
jQuery ajax:
=========
jQuery.ajax({
type: 'POST',
url: '/ajax.php',
data: {
user_email: user_email // this is user response
},
success: function(data){
//nothing to do
}
});
php file:
=========
$user_email = $_POST['user_email'];
$user = load_user_by_email($user_email);
if(empty($user)) {
// Function to hit this trigger "Email Address Not Found"
}
else {
// Function to hit this trigger "Email Address Found"
}
Please look into this and share a fruitful solution
Last edited by souvikgrmtech2 (2021-03-03 14:15:50)
Offline
Hi,
1. You should be using this attribute to perform plain check is valid e-mail format.
https://doc.livehelperchat.com/docs/bot … -attribute
2. Next once this is success you can use either this extensions
https://doc.livehelperchat.com/docs/bot … nformation
Or you can just use Rest API call call and based on output do what's required - https://doc.livehelperchat.com/docs/bot/rest-api
Offline
Here is an example
https://doc.livehelperchat.com/docs/bot … d-rest-api
Offline
I am trying to create a rest api for validating email, I just want to know where I will write my custom php code to validate email?
sample code:
===========
header('Content-type: application/json; charset=utf-8');
if (isset($_POST['email']) && $_POST['email'] == '***.com') {
echo json_encode(['valid' => true]);
} else {
echo json_encode(['error' => 'E-mail could not be found!']);
http_response_code(400);
}
Offline
I would suggest to read that one article.
Here you see where you define URL where request should be made...
https://doc.livehelperchat.com/docs/bot … figuration
Offline
Why rest api host url not hitting after trigger "Rest API"? Any idea? I couldn't find my api url in browser console.
Offline
Because it's happening form PHP side. Seems you are not understanding workflow and how in general Rest API workflows works... For these underknowlwdge questions there is commercial support. As i'm not teaching web basics...
Offline
Thanks a lot boss. Its working fine... Actually I am a newbie in rest api and the issue was regarding ssl verification
Offline
Pages: 1