Skip to main content

Send templated error notification emails via SMTP

Project description

notify-emailer

Small Python library. Sends HTML error-alert emails through SMTP.

Email includes application name, local timestamp, error message, and error details.

Install

Requires Python 3.9+.

pip install notify-emailer

Or install local checkout:

pip install .

Use

from notify_emailer.config import Config
from notify_emailer.sender import EmailNotifier

config = Config(
    server="smtp.example.com",
    port=25,
    from_addr="alerts@example.com",
    to_addr="ops@example.com",
    application="billing-api",
)

notifier = EmailNotifier(config)
notifier.send_error_email(
    error_message="Database connection failed",
    error_details="Timeout while connecting to db.internal:5432",
)

Set custom subject when needed:

config = Config(
    server="smtp.example.com",
    port=25,
    from_addr="alerts@example.com",
    to_addr="ops@example.com",
    application="billing-api",
    subject="Billing API error",
)

Config

Field Meaning
server SMTP hostname or IP address
port SMTP port
from_addr Sender email address
to_addr Recipient email address
application Name shown in email
subject Email subject; default: App Error Notification

SMTP behavior

Uses plain smtplib.SMTP. No authentication, TLS/STARTTLS, or retry logic built in. Configure server/network accordingly, or extend notifier for authenticated/encrypted SMTP.

License

MIT. See LICENSE.

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

notify_emailer-0.5.0.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

notify_emailer-0.5.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file notify_emailer-0.5.0.tar.gz.

File metadata

  • Download URL: notify_emailer-0.5.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for notify_emailer-0.5.0.tar.gz
Algorithm Hash digest
SHA256 a18f650d84c021c11eeac623ab6b84925886625d0f81782b42a26e02eaf025b4
MD5 ed228f5b23c8c5ca83e75e73d2a8c734
BLAKE2b-256 20e2f7f6c5d18f1165357abd449eb470168b068c3d9f79db1b2acf9dacfb3517

See more details on using hashes here.

File details

Details for the file notify_emailer-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: notify_emailer-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for notify_emailer-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7eec347cf7a0a76ba78c9910b24488851031c719494325ecbfefc9c013b812d0
MD5 ff4fcc02893d3dbf8a1c6a5d6ec9ef2f
BLAKE2b-256 000a6855e91933c0a3f1c2df2fcfe1cfd99dd3b4e1ae372e319d8e985e593172

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