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.6.tar.gz (3.9 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.6-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: TwilioToEmail-0.0.6.tar.gz
  • Upload date:
  • Size: 3.9 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.6.tar.gz
Algorithm Hash digest
SHA256 3131852447519ee707d88368ed42ae378f36a2057c48f71cd6302b024805bc23
MD5 8323bb92f8b837cc04a0c4ec559baca9
BLAKE2b-256 e48b1e2043e34f38d08ccce31f671b37a07ad89320b8faf7d5f31e7daa4fd2c7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: TwilioToEmail-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 6.9 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 bc40bd6ac0a6ddd6354c9dc878e84dc6d9e45447d3081743f2fdf3124a15ae97
MD5 d3fed0e14e0b87d04b280981e1c7f85e
BLAKE2b-256 c452f61fbcc58ba98d68e362f06c591e6e23efa21f501d22bea7417fc2cdb3a5

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