New PHP developers may not be aware that every script you run has 30 seconds to complete. If your API requests, database transactions, and data processing don’t complete in time, you will experience a server timeout. This is because PHP's max_execution_time helps prevent poorly written scripts from tying up the server.
Most developers will spend time Googling workarounds instead of focusing on the fact that this behavior is not a bug. In reality, people shouldn’t wait a whole minute or more for your page to load or process to complete within the browser. It’s just not an ideal user experience.
In this tutorial, we’ll learn how to measure the time it takes to send an SMS with Twilio Programmable Messaging for better application performance. At the conclusion, you will have learned how to:
- Build a simple script to send an SMS in PHP
- Use PHP’s microtime() function to measure script …
Developers often forget that when building a communication-based app it’s important for you to monitor costs in real time. Imagine you’ve built a bulk SMS application and need to send one message to 1,000 subscribers. You already know that (in the US) this SMS will cost you $7.50 USD ($.0075/msg), but are you aware of the available balance on your account to send it? The answer is in the console, but it’s tedious logging into your Twilio account every time you need to use the API within your app.
If you’re building a PHP application that needs to calculate API costs before use, this tutorial is for you! Maybe your application needs to check your balance before sending SMS or alert you when you’ve used too many voice minutes. Whatever the use case, this quick tutorial will help you integrate your balance into your PHP app.
When you allow users to register with your application without verifying their email addresses, you decrease the likelihood of being able to contact them again. If they’re allowed to sign up with an incorrect email address, there’s no guarantee that they’ll navigate to their profile and fix it later.
Email verification exists to correct this user experience flaw. When implemented correctly, email verification allows a user to sign up and receive a secure token sent to their email to confirm that they’re both real and have provided the correct email address.
By adding verification to any step of your user‘s journey, Twilio Verify allows you to fight fraud before it starts and verify users with email, SMS, or voice.
In this tutorial, you’ll be using Twilio Verify and SendGrid to override the default verification logic in Laravel and roll out your own system.
It’s important to note that Laravel comes …
It’s no secret to WordPress owners that the platform running their website and 35% of the Internet is a spam magnet. Its popularity has caused hackers to push the limits of their creativity, releasing spambots across a third of the Internet. This means that less-secure websites suffer from exploitations and data integrity issues.
Whether you are hosting your favorite cooking blog or The New York Times, your WordPress website needs extra prevention to stop fraudulent activity. That’s why we’re creating an email verification system and incorporate it directly into the WordPress user registration flow to reduce fraud. At the end of this tutorial, you will have a custom WordPress plugin that sends a secure email to every registrant before they can access their account.
Why Not Use WordPress’ Default Confirmations?
If you’re unaware, WordPress does include email confirmation for new registrations, but this alone doesn’t prevent skilled hackers from …
If you’re not familiar with
mail(), it’s a single function that only requires three arguments—a recipient, subject, and message—to deliver an email via one line of code. Sounds simple, right?
Well, if you’ve actually tried to use the function in your local environment, you know firsthand that it’s not always that easy. You’re probably reading this tutorial because you’ve experienced the
mail() function not working out of the box yourself. Maybe you’re even one of the 343K viewers of this unresolved, 5-year-old Stack Overflow ticket.
So why isn’t my PHP mail function sending any mail?
The truth is, there could be a number of reasons why your emails aren’t arriving in inboxes. However, I’ve found that most of those …
During times where we can’t be together physically, video conferencing helps reinforce and establish relationships by allowing us to monitor visual cues sometimes lost over the phone. Conference calls are great, but studies show that when we can’t see who’s talking, we’re more likely to get distracted by our favorite apps. Not only is video conferencing an excellent way to increase focus during meetings, but it’s also a great method for keeping in touch with family and friends during the coronavirus pandemic.
In this tutorial you will learn how to create your own video conferencing app in Vue.js, using the Laravel framework and Twilio Programmable Video. There is no software to download, nor tutorials to follow. The final result is a link to a mobile-friendly video chat room, capable of hosting up to 50 participants.
NOTE: This tutorial is written specifically for Laravel 7+ (although it may …
As much of the world is grappling with the overnight shift to work from home, the trusted conference call is a staple that is needed now more than ever. Teams that have only been separated by floors and walls are now teleworking from makeshift offices in kitchens and bedrooms.
While many software-as-a-service solutions exist, your company or organization may desire to roll out your own custom conference call solution or add it to an existing application. If PHP is your language of choice, this quick tutorial will teach you how to build your own conference line in PHP using Twilio Programmable Voice. Your team members will actually be able to call it directly and speak with one another from anywhere in the world.
If Node.js happens to be your preferred language, Sam Agnew just wrote an awesome version of this tutorial on the Twilio blog.
This tutorial …
Frequent and relevant communication with attendees is necessary when planning an event. There are too many opportunities for confusion if timely and detailed messages are not sent. Even when everything goes according to plan guests still need reminders as the event date draws closer.
Bulk emails are a great method to keep everyone in the loop.
In this tutorial, we will learn how to send bulk emails to an email list in PHP using Twilio SendGrid.
We’ll use a foreach() loop to parse through an array of email addresses and build a single array of recipients using SendGrid’s personalization class. SendGrid allows us to personalize each email that every recipient receives. We can even modify content based on the individual email address.
Tools Needed to Complete This Tutorial
To complete this tutorial you’ll need the following dependencies installed:
Get Started with …
Your inbox is undoubtedly full of transactional emails. While they prevent you from getting to inbox zero, without them, you’d have a less informative Internet experience.
Transactional emails are those sent from within an application when a certain event is triggered. In the case of an e-commerce store, you would send a transactional email when the user has completed their account signup and when they successfully complete their purchase.
Historically, sending an email in PHP has been one of the simplest tasks to complete. With only the mail() function, you need only to insert a call to the mail() function within any part of your workflow to send a transactional email.
It’s simplicity, though, has also been its downfall. If you are unfamiliar with the
mail() function, know that PHP developers have a love-hate relationship with it because, while it’s easy to implement, it has its challenges with bulk …
Due to their data transmission speed and low latency, WebSockets open up exciting possibilities for real-time apps. Many of your favorite apps such as Google Docs, Instagram, and Facebook are already using them to keep us in sync with each other using live data.
We’re going to dive deeper into the world of PHP WebSocket development by building a wake word and hot word detection assistant that communicates with us via SMS, similar to an Alexa.
To begin, we’ll use the introductory tutorial, “How to Create a WebSocket Server in PHP to Build a Real-Time Application”. We’ll modify the HTML to create a
<textarea> that streams the input value to our WebSocket. Our
Socket() class will listen for a list of predefined keywords and upon a match, send an SMS to the user.
If you haven’t already done so, download the repo here.