advanced-alchemy
Auto-activate for advanced_alchemy imports, alembic/, SQLAlchemyAsyncRepositoryService, SQLAlchemyAsyncConfig, repository_type, service_class, filters, or…
Auto-activate for litestar_email, EmailPlugin, EmailConfig, EmailService, EmailMessage, InMemoryBackend, SMTPConfig, ResendConfig, SendGridConfig, MailgunConfig, or SESConfig. Not for marketing APIs — use vendor SDKs.
$ npx -y skills add litestar-org/litestar-skills --skill litestar-email --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/litestar-emailContext preview
The summary Claude sees to decide when to auto-load this skill.
Auto-activate for litestar_email, EmailPlugin, EmailConfig, EmailService, EmailMessage, InMemoryBackend, SMTPConfig, ResendConfig, SendGridConfig, MailgunConfig, or SESConfig. Not for marketing APIs — use vendor SDKs.
name: litestar-email description: "Auto-activate for litestar_email, EmailPlugin, EmailConfig, EmailService, EmailMessage, InMemoryBackend, SMTPConfig, ResendConfig, SendGridConfig, MailgunConfig, or SESConfig. Not for marketing APIs — use vendor SDKs."
`litestar-email` 0.4.0 provides one async sending interface for console, memory, SMTP, Resend, SendGrid, Mailgun, Amazon SES, and custom backends. Match the backend already selected by the project; keep message construction independent from the transport.
registers a named Litestar dependency, not a global service singleton.
are list fields.
message and keep that I/O async.
pip install "litestar-email>=0.4.0" pip install "litestar-email[smtp]>=0.4.0" # aiosmtplib pip install "litestar-email[ses]>=0.4.0" # botocore for SigV4 pip install "litestar-email[httpx]>=0.4.0" # default HTTP transport pip install "litestar-email[aiohttp]>=0.4.0" # alternative HTTP transport
The HTTP API backends select `httpx` by default, but the transport is optional in `litestar-email` itself. Install the `httpx` or `aiohttp` extra (unless the project already provides that dependency), and select `aiohttp` only when the project standardizes on it.
from os import environ
from litestar import Litestar
from litestar_email import EmailConfig, EmailPlugin, SMTPConfig
email_config = EmailConfig(
backend=SMTPConfig(
host="smtp.example.com",
port=587,
username=environ["SMTP_USERNAME"],
password=environ["SMTP_PASSWORD"],
use_tls=True,
),
from_email="noreply@example.com",
from_name="Example App",
)
app = Litestar(plugins=[EmailPlugin(config=email_config)])`EmailConfig` fields:
| Field | Default | Contract | | --- | --- | --- | | `backend` | `"console"` | Registered name, import path, or built-in backend config object | | `from_email` | `"noreply@localhost"` | Default sender address | | `from_name` | `""` | Default display name | | `fail_silently` | `False` | Backend-specific best-effort delivery behavior | | `email_service_dependency_key` | `"mailer"` | Litestar DI key | | `email_service_state_key` | `"mailer"` | Key holding the config in app state |
The dependency and state keys occupy separate namespaces. Change them independently when the application already uses either key:
email_config = EmailConfig(
backend="memory",
email_service_dependency_key="email_service",
email_service_state_key="email_config",
)The handler parameter name must match `email_service_dependency_key`:
from litestar import post
from litestar.di import NamedDependency
from litestar_email import EmailMessage, EmailService
@post("/notifications")
async def send_notification(
mailer: NamedDependency[EmailService],
) -> dict[str, int]:
sent = await mailer.send_message(
EmailMessage(
subject="Notification",
body="You have a new notification.",
to=["recipient@example.com"],
),
)
return {"sent": sent}`EmailPlugin.on_app_init()` registers:
App state does not contain a permanently open `EmailService`. Use `plugin.get_service(app.state)` or `config.get_service(app.state)` when code outside handler DI needs a service derived from app state.
`subject` and `body` are required constructor arguments. Recipient lists have empty-list defaults, so provide at least one delivery recipient before sending.
from litestar_email import EmailMessage
message = EmailMessage(
subject="Monthly report",
body="The report is attached.",
from_email="Reports <reports@example.com>",
to=["owner@example.com"],
cc=["audit@example.com"],
bcc=["archive@example.com"],
reply_to=["support@example.com"],
headers={"X-Campaign-ID": "monthly-report"},
)
message.attach(
filename="report.pdf",
content=b"report content",
mimetype="application/pdf",
)
message.attach_alternative(
content="<p>The report is attached.</p>",
mimetype="text/html",
)`EmailMessage` does not accept `html_body` or `from_name`. Put a per-message display name in `from_email`, as shown above. Use `EmailMultiAlternatives.html_body` for the HTML convenience constructor:
from litestar_email import EmailMultiAlternatives
message = EmailMultiAlternatives(
subject="Welcome",
body="Welcome to Example App.",
to=["user@example.com"],
html_body="<p>Welcome to <strong>Example App</strong>.</p>",
)The message collections have these exact shapes:
| Field | Type | | --- | --- | | `to`, `cc`, `bcc`, `reply_to` | `list[str]` | | `headers` | `dict[str, str]` | | `attachments` | `list[tuple[str, bytes, str]]` | | `alternatives` | `list[tuple[str, str]]` |
`recipients()` returns `to + cc + bcc`; it does not include `reply_to`.
| Existing project constraint | Configuration | Extra | | --- | --- | --- | | Local output only | `backend="console"` | None | | Unit or integration tests | `backend="memory"` | None | | SMTP server or Mailpit | `backend=SMTPConfig(...)` | `smtp` | | Existing Resend account | `backend=ResendConfig(...)` | `httpx` or `aiohttp` | | Existing SendGrid account | `backend=SendGridConfig(...)` | `httpx` or `aiohttp` | | Exi
Opinionated, first-party agent skills, plugins, subagents, slash commands, and MCP servers for the Litestar framework and its ecosystem — publishable to every major AI agent and IDE from a single repo.
Repo: litestar-org/litestar-skills
Auto-activate for advanced_alchemy imports, alembic/, SQLAlchemyAsyncRepositoryService, SQLAlchemyAsyncConfig, repository_type, service_class, filters, or…
Auto-activate for Google ADK, LlmAgent, Runner, SQLSpecSessionService, Vertex AI, SSE agent chats, tool calls, or Litestar model workflows. Not for offline ML…
Auto-activate for guards=, Guard, ASGIConnection, JWTAuth, JWTCookieAuth, SessionAuth, role or tenant checks, or WebSocket auth. Not for frontend route…
Auto-activate for litestar_autowire, AutowirePlugin, AutowireConfig, domain_packages, AutowireIntegration, AutowireLoader, or clear_autowire_cache. Not for…
Auto-activate for uv build, hatch build, PyApp, PYAPP_*, wheel assets, GitHub release matrices, cargo-zigbuild, or python-build-standalone. Not for runtime…
Auto-activate for SQLAlchemyAsyncRepositoryService, SQLSpecAsyncService, create_filter_dependencies, LimitOffsetFilter, OffsetPagination, filters, or CRUD…