7/13/2023 0 Comments Git bulk sms sender pythonIn the end I settled for openpyxl as I had the most experience There are few alternative libraries for reading and writing excel files: Pandas, source bin / activate pip install africastalking python - dotenv openpyxl pip freeze > requirements. Save the installed libraries in a requirements.txt file.Using python package manager(pip) install africastalking python sdk, python-dotenv library and.Create a new virtual environment for the project or activate the previous one.Create a new directory and change into it.Create an app and take note of the api key. Python and pip (I am currently using 3.9.2 ) Any version above 3.5 should work.Īpi Key and username from your account.To effectively follow along with this post and subsequent code, you will need the following prerequisites. This method is not only highly scalable but efficient and flexible as you could potentially have multiple scripts for different classes or customize one script for the specific need. we'll add checks in case the message fails to send. In this article we'll take an spreadsheet of names and numbers, craft a custom message for each and send a custom message to each one. It may prove more work that it should be. Depending on the number of people, the frequency of texts and whether you need to customize the message. Furthermore,calling is not only tedious but highly inefficient and not scalable.Īnother option is to text the class manually or create a group chat. However, we can't assume they all have smartphones, they will be online in time to Naturally there are multiple options including Whatsapp/Telegram, calls, email etc. Assuming we are in university/college, and we needed to send our class members, a message to inform/remind them about class. Run the following commands in your terminal to create the project directory and virtual environment for this project.After my previous article, I got requested to do a follow-up tutorial using an Excel spreadsheet to send bulk messages.įor this one the background story is a simple one. Make sure you have Python 3 installed on your computer. Creating the application directory and virtual environment Application setupĪs mentioned earlier, we are going to be using the Flask framework for this project. You’d see a screen like the one below:Ĭlick on “Add an Existing Number” and select the phone number you purchased. To configure your messaging service to use the phone number you have purchased, go to your Twilio SMS service section on the console and click on the messaging service you created earlier. If you wish to get a number containing specific digits, you could enter them in the field provided as shown below.Īfter searching, you will be shown a list of available numbers from which you can make your purchase. Select your country from the dropdown and search for available numbers. Now you need to purchase a Twilio phone number for your app here on your Twilio console. Take note of the “SERVICE SID” that appears below the friendly name, as we are going to use it later to send our SMS. Press the “Save” button at the bottom to apply this change. Now select the messaging service your created earlier in the “Messaging Service SID” dropdown: Click on the red plus button and choose a name for your Notify service. Next, select “ Services” in the Notify section of the Twilio console. For the use case section, choose “Notifications, Outbound only”. Give the messaging service any name of your choice. From the Twilio console go to the messaging service section under Programmable SMS and create a new messaging service. To use Twilio Notify, you must first create a Messaging Service. Twilio Notify enables you to send notifications to any number of recipients with one API request. You can get the Account SID and Auth Token here: To follow this tutorial, you need your Twilio Account SID, Auth Token and Twilio phone number. If you are new to Twilio, create a free account now. Have Python 3 installed on your machine.Have sufficient understanding of Python and Flask.To follow this tutorial, you are expected to: The user creates a message, inputs the phone numbers of the recipients of the message, and then sends them an SMS as shown in the video GIF below. In this article, we are going to use the Twilio Notify service, along with Python and the Flask framework to build a Bulk SMS service. In addition, it enables companies to communicate with users who do not have smartphones. This is because SMS is reliable and usually has more reach and engagement than most other forms of bulk messaging. Very often, large companies use SMS to communicate or send broadcast messages to their users.
0 Comments
Leave a Reply. |