How to Create Text Message Alerts for PayPal Payments using Twilio, PHP, and YII 2
I was recently completing a payments integration for a recruiting firm that wanted to quickly deploy text message alerts for when buyers complete a PayPal payment flow. The business wanted the ability to instantly text payment info to the payee’s cell number. This tutorial is an introduction to integrating Twilio SDK into a Yii2 web application.
Preview of Text Alert
For this tutorial we’ll assume the following:
- PHP 5.4.0 or higher is required
- Twilio Account
- Paypal Account/Developer with restful application key and secret
- Composer installed
- Git installed and have a basic understanding
- Basic understanding of Yii2 PHP web framework
YII2 framework is defined as a high performance, component-based PHP framework for rapidly developing modern web applications. Personally, I love that it allows me to just focus on code instead of design patterns. I can scaffold views, data models and other trivial tasks that ...
Save Voicemails to Dropbox with Twilio Voice API, PHP, and Laravel
There are a number of ways to record calls with Twilio. Whichever method you decide to use, it is very important to keep the storage space used below the chargeable limit to prevent added cost. To achieve this, you need to backup up and delete your voice recording occasionally. Storage over 10,000 minutes per project is billed by the minute, once a month.
In this tutorial, we are going to discuss how to automate recordings management with recording status callback, download recordings programmatically via the REST API, save the recordings in Dropbox and finally delete the recordings programmatically via the REST API.
You will need the following technologies and tools:
- Twilio Account
- Dropbox account
- Composer globally installed
- PHP development environment Laravel
To follow along, you should have a basic understanding of PHP. Knowledge of the Laravel framework is not required. You can choose to use any other ...
How to Implement Account Verification and Login by Phone in Laravel
At times, you might want to create an app that uses a phone number/password pair as a means of authentication, as opposed to the normal email/password pair. In some other cases, you are not necessarily using phone numbers as a means of authentication, but having a phone number is critical to your app. In such situations, it is very important you verify that the phone numbers your users provide are valid and functional. One way to do this is to give them a call and tell them a code that they will have to provide to your app. If you use Gmail, then you are probably familiar with the voice call verification it uses. In this article, I will be showing you how to achieve that using Laravel and Twilio’s excellent service. Let’s get to it.
For this tutorial we’ll assume the following ...
Using SendGrid as Your SMTP Relay in Laravel PHP
Laravel is one of the most famous PHP MVC frameworks with a great community. It provides all the features that are required to create your project, whether it is for personal or enterprise use. Laravel supports a wide range of SMTP providers by default, but at this time SendGrid is not available for us out-of-the-box.
This tutorial will help you to implement SendGrid to send emails over SMTP. After we’ve finished, you will have a running Laravel application that allows you to send emails to registered users using SendGrid. An added benefit is, we will be able to check out whether your email is read or opened by the user.
Set Up a New Laravel Project
If you don’t have Laravel installed in your system, install it first from the Laravel Official Documentation. A ...
Creating a Smart Assistant using Twilio Voice, Amazon Alexa, and Laravel
As a small business owner, I am always trying to increase my productivity and grow my business. Why have a meeting for what can be said in an email? Unfortunately, many of my clients don’t check their email regularly, so I have to call them. There’s no better way to decrease your productivity than a million simple phone calls every day. If you’re in the same boat as I am, Amazon Alexa + Twilio Voice is the perfect solution.
For this tutorial, we'll assume the following:
- You have PHP 7.2 installed
- You are familiar with Laravel
- You have Composer globally installed.
- You have an Amazon Developer account.
Let's get started!
Create a Laravel Project and Install the Twilio SDK
The first thing we need to do is create a fresh Laravel project. The simplest way to do this is by using Composer.
$ composer create-project --prefer-dist ...
How to Create an SMS Portal With Laravel and Twilio
At some point in your application workflow, you may need to pass important information to your users. Thanks to the advancement in web technologies, this can easily be done with push notifications. However, most of these services require your users to have an internet connection and unfortunately, this isn’t always the case. Luckily, we can overcome this by using a notification system that does not rely on the internet.
In this tutorial, we will teach you how to use Twilio’s Programmable SMS to create an SMS notification portal using Laravel. After we’re finished, you would have developed a custom SMS notification portal that allows you to notify your users via a dashboard with SMS.
In order to follow this tutorial, you will need:
- Basic knowledge of Laravel
- Laravel Installed on your local machine
- Composer globally installed
- MySQL setup on your local machine
- Twilio Account
Setup Project ...
How to Build an SMS Payment Notification System for Stripe with Laravel
For many online stores, it’s important as a business owner to be able to receive real-time notifications whenever a sale occurs in your store. In this tutorial, we will be looking at how we can achieve real-time notifications via SMS using Twilio’s REST API whenever a new sale occurs on your store.
To follow along, you’ll need the following:
Create A New Laravel Project
To get started, we need to install a new Laravel project. There are different ways to go about this, but for the sake of this tutorial, we’ll be using Composer. If you’d prefer an alternative, you can visit the docs to learn about the different ways to install a new Laravel project.
Open your terminal, and run the following command:
$ composer create-project ...
How to Send an SMS When Your Cron Job Fails
A modern-day business that relies heavily on tech to operate requires virtually no downtime at all. Case scenario would be an e-commerce business which needs to reconcile its sales every day through cron jobs that run at scheduled times of the day. Mitigating issues when the crons fail takes time since there is no way to alert the stakeholders. This may lead to huge losses or embarrassment to the company depending on the type of reports you are generating via cron.
In this tutorial, we are going to learn how to use the Twilio Programmable SMS API to send text messages when a cron job fails. We will create a simple cron job that sends weekly emails to users then integrate with Twilio Programmable SMS API to send an SMS when the cron fails.
Ensure you have the following installed in your local development environment.
- PHP - Version 7.0 ...
Phone Verification via Voice with Laravel, Twilio, S3 and AWS Polly
Twilio offers an array of products and solutions that enable you to engage your customers. One of which is Programmable Voice that allows you to make and receive calls, as well as monitor calls, using the Voice API.
In this tutorial, you will learn how to use Twilio’s Programmable Voice API to implement a phone number verification system that places a voice call to the user’s phone from your PHP Laravel Application. By the end of the tutorial, you will have developed a PHP Laravel Application with an authentication system that can verify a user’s phone number, by placing a call through to it.
- PHP environment running 7.3+
- A Twilio Account
- An AWS Account and S3 bucket
Setup Laravel and Twilio PHP SDK
Firstly, we need to download Composer, a PHP package manager. We will use Composer to install Laravel and other ...
How to Create an SMS Weather Forecast App using PHP & Twilio
Imagine you’re on vacation and have limited or no access to the internet. Maybe you would like to go surfing or skiing and your access to a forecast is non-existent. This type of scenario is a very good use case of forecasting weather using SMS and a server-side language such as PHP. That's what we are going to learn how to build in this tutorial.
- PHP 7 development environment
- Global installation of Composer
- Twilio Account
- An OpenWeatherMap Account
- Global installation of ngrok
Set Up Our Development Environment
To kick start our project we will need to create a project directory for it. You may use
Weather-Appas this is what I will be using too. In the folder create the following files.
Next, we need to set up our .env file.
NOTE: The .env file is a hidden file we create on ...