/tinymail

A tiny marketing and transactional email api

Primary LanguagePython

tinymail

For something in between Mailchimp and Mailgun, but free.

This is a simple API based on FastAPI, SQLModel and Celery

What can you do with it ?

  • Import contacts with as many metadata as you want and filter automatically the wrong emails
  • Create marketing campaigns and filter contacts into segments
  • Get access to your campaigns's open rates
  • Send unique emails right now or at a specific date

How ?

Installation

git clone https://github.com/lmanhes/tinymail
pip install -r requirements.txt

Settings

Create a .env file (or create env var) with the following variables:

# Your EMAIL + SMTP config
MAIL_ADDRESS = "hello.tinymail.com"
MAIL_PWD = "tinymailpassword"
SMTP_HOST = "smtp.gmail.com"
SMTP_PORT = "465"
SMTP_SSL = "True"

CONF_TOKEN_SECRET_KEY # random string, useful for encryption of tokens inside mails
CONF_TOKEN_PASSWORD_SALT # random string, useful for encryption of tokens inside mails

DATABASE_URL
REDISCLOUD_URL 
BASE_URL = "https://myapi/" # this is the API base url

ENV_STATE # dev/staging/prod/...

Usage

Run the following commands to start:

  • a redis instance
  • a celery worker instance
  • the main web app
redis-server
celery -A app.worker worker -l info
uvicorn app.main:app

Alembic migrations

alembic revision --autogenerate -m "your message"
alembic upgrade head