Skip to main content

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.

  1. Create a folder for your project
  2. Install FastAPI, Uvicorn, and TwilioToEmail
pip3 install fastapi uvicorn TwilioToEmail
  1. 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

TwilioToEmail-0.0.3.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

TwilioToEmail-0.0.3-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file TwilioToEmail-0.0.3.tar.gz.

File metadata

  • Download URL: TwilioToEmail-0.0.3.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

Hashes for TwilioToEmail-0.0.3.tar.gz
Algorithm Hash digest
SHA256 df538b709b230fd6271f15e85c1004976570ada969a040a79f63ac3d5231d334
MD5 f2f2abd9ae9f46dac7fe9eccdc5fc53e
BLAKE2b-256 7cdbf0d18631ca95d9cfcf0ba2a0dae930747bbb0053f1e82c67c9bffc0e38d0

See more details on using hashes here.

File details

Details for the file TwilioToEmail-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: TwilioToEmail-0.0.3-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

Hashes for TwilioToEmail-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ee308922c6493b230e3430622192dc635ea3c7108544dcceceb5fe0308a2cf45
MD5 58e008d5dbdbe88d1e98b2a1b1e79f5f
BLAKE2b-256 9e5516491a7bcabed8014d36b72f03a742e9f5dea35e19487a2f306264fc6cf5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page