Skip to content

Latest commit

 

History

History

flask-secret-santa

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Telnyx-Python Secret Santa Generator

Telnyx

Sample application that automatically texts all participants in a secret santa their assigned person!

Pre-Reqs

You will need to set up:

What you can do

  • Launch site with form to submit multiple participants in Secret Santa
  • Have the assignments automatically sent to each participant's phone number

Usage

The following environmental variables need to be set

Variable Description
TELNYX_API_KEY Your Telnyx API Key
TELNYX_PHONE NUMBER Your Telnyx Phone Number
APP_PORT Defaults to 5000 The port the app will be served

Requirements

This app uses several pip packages to execute. To install run the following:

$ pip install [requirement]

Requirements:

telnyx
os
random
phonenumbers
dotenv
flask

.env file

This app uses the excellent python-dotenv package to manage environment variables.

Make a copy of .env.sample and save as .env and update the variables to match your creds.

TELNYX_API_KEY="YOUR_API_KEY"
TELNYX_NUMBER="YOUR_TELNYX_NUMBER"
APP_PORT=5000

Install

Run the following commands to get started

$ git clone https://github.com/d-telnyx/demo-python-telnyx.git

Run

Start the server python main.py

Once everything is setup, you should now be able to:

  • Run the server and access it at localhost:PORT (i.e. localhost:5000)
  • Add participants to the secret santa and have their pairs generated
  • Have texts sent to all participants informing them who they are buying presents for!

Happy Holidays!