Support the ongoing development of Laravel.io →
posted 10 years ago
Forms
Last updated 2 years ago.
0

You can indeed use Text Marketer or other SMS providers with Laravel.

The larger companies like Twilio provide their own libraries https://packagist.org/packages/twilio/sdk that you can load in via composer and it gives you a function to call - you just pass the content and number.

If there isn't a dedicated library then using the Guzzle library with PHP makes it quite easy to carry out the GET or POST requests to your chosen provider's API. http://docs.guzzlephp.org/en/latest/ (again load it in with composer)

Text Marketer is fairly simple to get off the ground, it's just a simple GET request http://www.textmarketer.co.uk/basic-connectivity

Last updated 2 years ago.
0

Thanks for the reply @gregrobson. Text Marketer looks like a good simple solution. So for 1,000 texts it will cost roughly $50. Is there a free API to use? Are there any other options.

Here is what I am looking to do.

User 1 fills out form and inputs number to send their input to number entered via sms from form

User 2 receives User's 1 text message from app online and has choice (interactive text message or could be text this "word" back to ) of three options for a response.

User's 2 response is updated on online app(displayed on front page) and entered into the database (what their choice is). Think of voting.

Thank you for all the input and suggestions.

Last updated 2 years ago.
0

Just an update. I found I think one of the best API services for SMS. Here

Last updated 2 years ago.
0

Text Marketer have a PHP class you can download and include - this takes care of the CURL requests. (Twilio has a composer package which is slightly more convenient.)

Looks fairly straightforward to achieve, you will just need a table or two to store the options and numbers. To get the response when somebody replies you will need a webhook in your routes file for incoming SMS messages http://www.textmarketer.co.uk/receiving-sms

So you might have a GET route for Text Marketer on http://mylaravelsite.com/TextMarketerInbound/ When they receive a text they will make a request on your site like this. http://mylaravelsite.com/TextMarketerInbound/?number=4477777777&message=keyword+and+some+other+text

You should be able to use the number (note the international format) to what you have in your database.

Last updated 2 years ago.
0

Great, thank you for the info. I changed my mind and decided to use Twilio's API after all since as you said it already comes with a user friendly package. Also, it is less than one cent per SMS message.

http://www.twilio.com/help/faq/sms/how-can-i-have-users-send-text-messages-to-each-other-over-twilio

You said use a webhook. I am not familiar with this. Will I need this with Twilio?

Last updated 2 years ago.
0

You will need a webhook if you wish to analyse any SMS responses. Basically a webhook works in a similar way to a form submit on your own website. Only instead of the data being the result of a web page form submit, it's just a standard GET/POST request according to how that particular provider implements their API.

Twilio supports GET and POST - GET might be easier to test. https://www.twilio.com/docs/api/twiml/sms/twilio_request

So what happens is:

Some providers use webhooks to let you know if a message has been delivered, and sometimes (if provider and handset support it) whether it has been read as well.

Last updated 2 years ago.
0

This is exactly what the Twilio rep said on the phone today. It will be a POST http protocol.

Basically when the text message is sent it is recorded in the Twilio log and then I have to create a connection with Twilio in order to grab what I need.

This will be a blast implementing in my app.

Last updated 2 years ago.
0

Oh and if you ever want to test (easily) what any service is sending to you. Give them a URL for a service like http://requestb.in/ - it's easier to check headers, post data, source IPs etc.

Last updated 2 years ago.
0

thank you

Last updated 2 years ago.
0

I am using Twilio on a project and absolutely love it. It's insanely cheap, too. $0.0075 per text... for $1000 texts it's the price of 2 cups of coffee.

Last updated 2 years ago.
0

Hi, swgj19. I do not know of any free bulk SMS providers. You need to find a SMS gateway and purchase credit. Or try contact this guys see if they provide free credits: http://smsfree4all.com/free-text-all-countries.php

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

swgj19 swgj19 Joined 11 Mar 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.