A middle man service that acts as a Twilio wrapper
Project description
About the Project
I was going through Zapier's most popular projects and saw one that did something simialr with Twilio and an Email. I decided i'd make my own version that could do the same thing with minial setup time. All you have to do is write a few lines of code to get everythig oing.
Getting Started
Prerequisites
The only package you need outisde of everything that comes with Python3 is the requests library.
Quick Start
I'll show you how to get a quick example started. You will need something like ngork to open a quick and easy public tunnel for your project.
- Create a folder for your project
- Install FastAPI, Uvicorn, and TwilioToEmail
pip3 install fastapi uvicorn TwilioToEmail
- Make a Python file to run FastAPI
from fastapi import FastAPI, Request
from TwilioToEmail import SmsMessage
from TwilioToEmail import Email
@app.post("/")
async def root():
#pass the request body into a var, then decode the body
request_body = await request.body()
request_body = request_body.decode()
#create the SmsMessage class from TwilioToEmail
twilio_message = SmsMessage(request_body.split("&"))
#create the Emailclass from TwilioToEmail, then call the send_email() function
email = Email("recievers_email", "senders_email","subject_line")
#now simply pass the SmsMessage object into the send_email() function
email.send(twilio_message)
#return HTTP response 200
return(200)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file TwilioToEmail-0.0.2.tar.gz.
File metadata
- Download URL: TwilioToEmail-0.0.2.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a5cbce1a100f31e39fea65437f444827b172a9b53bb0b28d8bf71a43f469dd8
|
|
| MD5 |
16605a812d2f40717b00ccdbfc0bdfd2
|
|
| BLAKE2b-256 |
8728957bdd3c0b1227da569a1d5dfa74fe078c92678046ae78a82aec6cac15af
|
File details
Details for the file TwilioToEmail-0.0.2-py3-none-any.whl.
File metadata
- Download URL: TwilioToEmail-0.0.2-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e4d697d3b5ea23bbd6c28b6a57e200b49bb772c4a36c4ef94e4e8baf4c8ce5e
|
|
| MD5 |
b10153b02d0476977c8a7c35fdaef667
|
|
| BLAKE2b-256 |
d5e4eb286d3d2cf67bedf350e4e5cd4b2cb4148202d7d8ffa46231e626fce979
|