Quantstrip docs
Open Dashboard

Quick usage

from quantstrip import send_email

send_email(
    subject="Strategy alert",
    body="Position limit reached for SPY.",
    to="ops@yourfirm.com",
)

send_email is a module-level convenience function that sends through the default account. For a named account, cc, or HTML body, use email_manager directly.

EmailAccount

A dataclass representing one configured account:

@dataclass
class EmailAccount:
    email_account_id: int
    name: str
    provider: str
    smtp_server: str
    smtp_port: int
    use_tls: bool
    username: str
    password: str
    from_address: str
    from_name: str
    is_default: bool = False

EmailManager

get_accounts()

All configured accounts.

Returns Dict[str, EmailAccount], keyed by account name.
get_default_account()

The account marked default, or the first available account if none is marked.

Returns Optional[EmailAccount].
get_account(name)

Look up one account by name.

Returns Optional[EmailAccount].
send(subject, body, to, account=None, cc=None, html=False)

Sends an email via SMTP through account (or the default account if omitted).

Returns (success: bool, message: str).
test_account(name, test_recipient)

Sends a test email through the named account. Equivalent to the Notifications page's "test connection" action.

Returns (success: bool, message: str).
create_account / update_account / delete_account

Programmatic account management, equivalent to the operations available from the Notifications page's UI.

Account passwords are stored obfuscated (base64 + character rotation), not encrypted — the same scheme used for secret-typed Settings values.