Skip to main content

herfy-email

Provider-abstracted email SDK for Herfy applications. Send transactional email using only your Control Center client_id and client_secret — no email provider credentials in app config.

Installation

pip install herfy-email[mailgun]

Usage

from herfy_email import HerfyEmailClient, AsyncHerfyEmailClient

# Sync
client = HerfyEmailClient.from_credentials(
    client_id="app_pettycash",
    client_secret="your_secret",
    control_center_url="https://cc.herfy.com",
)
client.send(to="user@herfy.com", subject="Hello", html="<p>Hello</p>", text="Hello")

# Async (FastAPI)
client = AsyncHerfyEmailClient.from_credentials(
    client_id="app_pettycash",
    client_secret="your_secret",
    control_center_url="https://cc.herfy.com",
)
await client.send(to="user@herfy.com", subject="Hello", html="<p>Hello</p>", text="Hello")

# From environment variables (CC_CLIENT_ID / AUTH_CLIENT_ID, CC_CLIENT_SECRET / AUTH_CLIENT_SECRET, CC_URL / CONTROL_CENTER_URL)
client = HerfyEmailClient.from_env()

How it works

  1. SDK authenticates with Control Center via POST /api/app-auth/token (cached, TTL 300s)
  2. SDK fetches provider config from GET /api/config/email (cached for process lifetime)
  3. SDK calls the configured provider (Mailgun, SendGrid, …) directly

Switching email providers requires only a Control Center env-var change — zero app changes.

Provider support

Provider Extra
Mailgun pip install herfy-email[mailgun]
SendGrid pip install herfy-email[sendgrid]

Control Center configuration

EMAIL_PROVIDER=mailgun
MAILGUN_API_KEY=key-xxxxxxxxxxxxxxxxxxxxxxxx
MAILGUN_DOMAIN=mg.herfy.com
MAILGUN_FROM_ADDRESS=noreply@herfy.com

Metadata

Release files for herfy-email 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for herfy-email 1.1.0
File Size Uploaded Provenance Actions
herfy_email-1.1.0.tar.gz 11.1 kB With provenance Details for herfy_email-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for herfy-email 1.1.0
File Interpreter ABI Platform Actions
herfy_email-1.1.0-py3-none-any.whl Python 3 none any Details for herfy_email-1.1.0-py3-none-any.whl

Total release size: 22.4 kB

Release files / herfy_email-1.1.0.tar.gz

Download URL herfy_email-1.1.0.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c4138763839166e27220f07664b6b3d00d740a4361d4f3c516f7a7cf0a0ae76c
BLAKE2b-256 checksum
How to use checksums
cd67db451f689c846f59384cd7cb7cb05bb8d6d144cf4a9ba03b33539c5ed3fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 26, 2026.

Transparency log

Release files / herfy_email-1.1.0-py3-none-any.whl

Download URL herfy_email-1.1.0-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c412ab33f728e52cdd8b1ca888c18bfc4bff11e60729f8815f9f8eab7762850f
BLAKE2b-256 checksum
How to use checksums
103feafb04bc4c66f988adfc2dc14837de0f70aa0982bcb74f3ac622fb362ad1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 26, 2026.

Transparency log

Security for herfy-email 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for herfy_email-1.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page