integrating SMS gateway

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

on this click by the customer the following actions happen :-

1) random number is generated and sent by the sms gateway script to the users phone as sms.
2) the same random number is sent to the users row in comprofiler table.
3) the user is re-directed to the HTML form to input code use received on sms.

will all these done as separate actions and not as one code action ?

Thanks
Pranay

Please Log in to join the conversation.

8 years 4 months ago #275947 by krileon
Replied by krileon on topic integrating SMS gateway
1-3 can probably be done as a single code action. Since you can have multiple codes in 1 action you'd have 1 that's Method of PHP that handles 1-2 then 3 which would be Method of HTML presets the form. You'd need a second action that the form would submit to and validate the code.


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 #275949 by pranaydhruv
Replied by pranaydhruv on topic integrating SMS gateway
Dear Kyle,

Please be specific, how can i achieve it ? do i create 3 seperate actions and chain them ?
when you say method please elaborate.


Thanks
Pranay

Please Log in to join the conversation.

8 years 4 months ago - 8 years 4 months ago #275990 by krileon
Replied by krileon on topic integrating SMS gateway
How specific do you mean? I'm sorry, but I'm not writing the code out for you. We do not provide custom coding here. I can only provide you with suggestions or small examples.

You need 2 actions. The first action will have 2 Code usages in it (see the + button to the far right of the code action). 1 of the Code usages will generate your number, send it as SMS, then store it to their profile. The next Code usage will be your HTML form. There's a Method parameter to determine what type of code the Code action is (e.g. PHP, HTML, etc..). The second action is what your <form action URL will be and is where you'll validate the form submit to ensure the code is right. Example as follows.

Global
Triggers: None
Type: Code
User: Automatic
Access: Everybody
Action
Code 1: (Method PHP)
$SMScode    = rand();

// SEND SMS HERE

$user->set( 'cb_phoneverificationcode', $SMScode );

$user->store();
Code 2: (Method HTML)

File Attachment:

File Name: sms_html_f...1-04.txt
File Size:1 KB


Your form would submit to the below action. You can use whatever action you want below. Could be a redirect, another code action, etc.. just depends on what you want to do. The validation is handled by the conditional and if the condition passes the action will execute. Otherwise it'll just fail and display nothing, which you could have a 3rd action that and have the form fire both of them by using &actions=ACTION_ID_1,ACTION_ID_2 in the URL to handle a case where the code doesn't match.

Global
Triggers: None
Type: ANY
User: Automatic
Access: Everybody
Conditional
[cb_phoneverificationcode] Equal To [post_veficationcode]


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.
Attachments:

Please Log in to join the conversation.

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

Thanks for your response , since my last post i continued working on my code and the queries and based on your previous inputs about it being vulnerable,and i have now managed to make it secure and parameterized, in addition i have tested and tried to pass random sql injection queries and it seems to withstand the test of sql injections. So far so good as it seems to work fine end to end. :-)

Thanks
Pranay

Please Log in to join the conversation.

8 years 4 months ago #276004 by krileon
Replied by krileon on topic integrating SMS gateway
That's very good news. I hope you have a working solution soon. If you need any further help with the CB Auto Actions usage and the above isn't enough please let me know where you're having problems in configuring the actions.


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: 0.189 seconds

Facebook Twitter LinkedIn