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

Uploaded Python 3

File details

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

File metadata

  • Download URL: TwilioToEmail-0.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 c82d2c9b2c4897c478926438f6c80398d39b70d6e04ceb5ad4c5704ff23e2bc2
MD5 7cacb1dfcc2ccb9c2ae8c3960aab44a2
BLAKE2b-256 5eced2dbd528a6688faf47de571ec24efaef47728908bd66507fb311b75aa568

See more details on using hashes here.

File details

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

File metadata

  • Download URL: TwilioToEmail-0.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 953feea20aada91f6a1232c02d0fe3dfb15662ff21995899a825526149c5d313
MD5 af0b273a416c7bbceacf99f09fffe1e8
BLAKE2b-256 5bacee74ea5993b304d4d6e3617fd8b20dfdbb32669c4dd6e82fd6f2bd124376

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