integrating SMS gateway

8 years 4 months ago #275856 by pranaydhruv
Replied by pranaydhruv on topic integrating SMS gateway
Hello Kyle,

Please let me know how to achieve my use case with just CB tools?

1) Generate random verification code and run sms gateway script with just the click of a button by user ?

2) This random generated code will be sent on sms to user and also should be stored in a field in that users row in comprofiler table.

3) the user must have an input field to enter the code he received on sms in the website. and after they hit submit. their input needs to be checked against the field value stored in the database .

4) if the field value matches they should get a success message else they should be asked to try again.

5) once they have successfully verified that button to verify they phone number would not show again on their profile.


Thanks
Pranay

Please Log in to join the conversation.

8 years 4 months ago #275857 by krileon
Replied by krileon on topic integrating SMS gateway
The Code action has a Method for PHP so you can do whatever you want except you'll have access to Joomla and CB API as well as substitution support. Latest CB Auto Actions has a None trigger. When in use you can directly access the action to execute it. This means it can be a URL for a button, an HTML form, etc..

Also note CB Query Field has a Query Validation feature. The validation can be used to make sure 1 value in the database matches another value in the database for example. There's a lot of options available without excessive custom coding.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

8 years 4 months ago #275860 by pranaydhruv
Replied by pranaydhruv on topic integrating SMS gateway
Hello Kyle,

I am willing to try it , please be more specific what i need to do ?

1) start should be with a custom HTML cb field that will host a button. It should be visible to user only on his profile when he has not verified his phone number.

2) this and other steps are from my last post.


Thanks
Pranay

Please Log in to join the conversation.

8 years 4 months ago #275878 by krileon
Replied by krileon on topic integrating SMS gateway
You can condition your Custom HTML field with CB Conditionals and CB Privacy to help control its visibility. The button can then link directly to an action that has triggers set to None (the direct URL is provided on the Global tab of your action). I guess your first action would be a Code action with Method set to HTML to display your form. The form would then post to another action that'll handle your coding part (Code action with Method of PHP).


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: nant

Please Log in to join the conversation.

8 years 4 months ago - 8 years 4 months ago #275913 by pranaydhruv
Replied by pranaydhruv on topic integrating SMS gateway
Dear Kyle,

I created the following :-

1) Custom HTML field and set it to display only when the user views their profile and put the url of the auto action on it. I also created 2 fields named - phoneverificationcode & userinputphonecode

2) I created a code action which has an HTMLcode for the form and also a php code. but i get an error when i run this action. Please note the error below :-
<?php
$phverf= rand(); //stores the value of rand function in phverf variable
echo "$phverf" . "\n"; // echo this just to check...when users inputs the random number received on sms

$sql = "UPDATE tablename SET cb_phoneverificationcode ='$phverf' WHERE id = $myId";

?>
Fatal error: Function name must be a string in /plug_cbautoactions/models/code.php on line 48

Thanks
Pranay

Please Log in to join the conversation.

8 years 4 months ago #275919 by krileon
Replied by krileon on topic integrating SMS gateway
You do not need to include the PHP tags when using a Code action. The Code action executes the supplied string as PHP using create_function by creating an anonymous function for it and running it. There's some slight differences to its usage compared to a plain PHP file. Also note you do not need to use PHP to change the fields value. You can do that using a Field action then under Parameters enable Format Functions and use the below to substitute in rand().

[cb:parse function="rand" /]


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 1.670 seconds

Facebook Twitter LinkedIn