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.4.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.4-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: TwilioToEmail-0.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 8f67868f6c756e34c63574053f666c9bf254ec8c438588f85aa8d4ae7058a761
MD5 6d108e047bb6ed5022db32cd5a644708
BLAKE2b-256 7d45fe829e5cd884e5b85e86f82d10c1c6e7810458c088856845cad9215675cd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: TwilioToEmail-0.0.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6d789c77a58ac01392f0b86ca7aadbcdfa54f1de130c2645596d7130fb69d4bf
MD5 e75d8731a517e27c2e9f1aeb332f9550
BLAKE2b-256 68b945c52f299bb63993e416f80479f9c94d3ca1fe42addc266f3cf150e8cf1c

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