Skip to main content

notifyvia-email

The frontend Python library for notifyvia.email.

Installation

pip install notifyvia-email

or with uv:

uv add notifyvia-email

Requires Python 3.13+.

Quick start

from notifyvia_email.v2 import NotifyViaEmail, SendResult

client = NotifyViaEmail(api_key="your-api-key")

resp = client.send(
    to="you@example.com",
    subject="A message from your website",
    text="Do you have any strawberry cheesecake?",
)

if resp.ok:
    print("Email queued for delivery")
else:
    print(resp.result, resp.errors)

API versions

Each API version has its own client with the same interface:

from notifyvia_email.v1 import NotifyViaEmail  # POST /api/v1/send
from notifyvia_email.v2 import NotifyViaEmail  # POST /api/v2/send

v2 adds the reply_to parameter. Everything else is shared.

Sending HTML

Provide html, text, or both. At least one is required, otherwise send() raises ValueError.

resp = client.send(
    to="you@example.com",
    subject="Welcome!",
    html="<h1>Welcome</h1><p>Thanks for signing up.</p>",
    text="Welcome! Thanks for signing up.",
    reply_to="support@example.com",  # v2 only
)

Spam checking and rate limiting

A typical contact form setup. The rate limiter needs the sender's IPv4 address.

resp = client.send(
    to="owner@example.com",
    subject="New contact form submission",
    text=form_message,
    enable_spam_checker=True,
    enable_rate_limiter=True,
    limit=3,             # max requests...
    within_seconds=300,  # ...per 5 minutes, per IP
    ipv4_address=request.remote_addr,
)

Choosing a service

resp = client.send(
    to="you@example.com",
    subject="Hello",
    text="Sent via Postmark",
    service="postmark",  # "zepto" (default) or "postmark"
)

Handling the response

send() returns a SendResponse with:

  • result: a SendResult enum member
  • errors: the API's errors field (or None), e.g. per-field validation messages
  • ok: True when the email was accepted for delivery
from notifyvia_email.v2 import SendResult

resp = client.send(to="not-an-email", subject="Hi", text="Hello")

match resp.result:
    case SendResult.EMAIL_PROVISIONING:
        print("Sent")
    case SendResult.INVALID:
        print("Validation failed:", resp.errors)
        # {'to': ['Not a valid email address.']}
    case SendResult.RATE_LIMIT_EXCEEDED:
        print("Too many requests, try again later")
    case SendResult.SPAM_DETECTED:
        print("Message rejected as spam")
    case SendResult.CONNECTION_ERROR:
        print("Could not reach notifyvia.email:", resp.errors)
    case _:
        print("Failed:", resp.result.name, resp.errors)
SendResult HTTP Meaning
EMAIL_PROVISIONING 200 Accepted and queued for delivery
AUTHORIZATION_REQUIRED 401 Missing or invalid API key
RATE_LIMIT_EXCEEDED 429 Too many requests from this IP in the window
INVALID 460 Request validation failed (see errors)
INVALID_ACCOUNT 461 API key accepted but no matching account
INVALID_SERVICE 462 service is not a supported provider
INSUFFICIENT_CREDITS 463 Not enough credits to send
IPV4_ADDRESS_NOT_PROVIDED 464 Rate limiter enabled without ipv4_address
SPAM_DETECTED 465 Body matched the spam dictionary
SENDER_IPV4_BLOCKED 466 Sender IP is on the global block list
UNKNOWN_ERROR - Unexpected status code from the API
CONNECTION_ERROR - Network failure or timeout; errors has details

Configuration

client = NotifyViaEmail(api_key="your-api-key", timeout=5.0)  # seconds, default 10

See the notifyvia.email docs for full API details.

Metadata

Release files for notifyvia-email 0.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 notifyvia-email 0.1.0
File Size Uploaded Provenance Actions
notifyvia_email-0.1.0.tar.gz 4.1 kB Without provenance Details for notifyvia_email-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for notifyvia-email 0.1.0
File Interpreter ABI Platform Actions
notifyvia_email-0.1.0-py3-none-any.whl Python 3 none any Details for notifyvia_email-0.1.0-py3-none-any.whl

Total release size: 9.9 kB

Release files / notifyvia_email-0.1.0.tar.gz

Download URL notifyvia_email-0.1.0.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f087572a1856cb08a7b5baf031d5e3d4eea9ef5830175e93ec77a0273df95690
BLAKE2b-256 checksum
How to use checksums
d802161f7e3d5b5875189a812c104ceb564637c96dc0615bae65ce6cf555a028
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / notifyvia_email-0.1.0-py3-none-any.whl

Download URL notifyvia_email-0.1.0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b095b477d2df3341e2f17c1a0f5955ebadba4960d11d6165a0b286e476fd9748
BLAKE2b-256 checksum
How to use checksums
60942c8a47d23f0036ed52a34a3c5931f6e300616882e6497c87f53ede2a4954
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for notifyvia-email 0.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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