{% extends "base.html" %} {% block title %}Mailer{% endblock %} {% block breadcrumb %}Mailer{% endblock %} {% block content %} {# ═══════════════════════════════════════════════════════════════════ AQUILIA ADMIN — COMPREHENSIVE MAILER DASHBOARD Providers · Configuration · Security · Templates · Send Test · Health ═══════════════════════════════════════════════════════════════════ #}
AquilaMail — Production-ready async mail subsystem • Providers, templates, security & delivery
Enable the mail integration in your workspace.py to use the Mailer admin page.
app.integrate(Integration.mail( default_from="noreply@myapp.com", console_backend=True, providers=[ Integration.MailProvider.SMTP( name="smtp", host="smtp.example.com", port=587, ), ], ))
No Providers Configured
Add providers in your Integration.mail(providers=[...]) configuration.
{{ config|tojson(indent=2) if config else '{}' }}
# workspace.py
from aquilia import Integration
workspace = (
Workspace("MyApp")
.integrate(Integration.mail(
default_from="{{ default_from }}",{% if subject_prefix %}
subject_prefix="{{ subject_prefix }}",{% endif %}{% if console_backend %}
console_backend=True,{% endif %}{% if preview_mode %}
preview_mode=True,{% endif %}
providers=[
{% for p in providers %}{"name": "{{ p.name }}", "type": "{{ p.type }}"{% if p.type == 'smtp' %}, "host": "{{ p.host or 'smtp.example.com' }}", "port": {{ p.port or 587 }}{% endif %}},
{% endfor %}
],
))
.integrate(Integration.admin(
modules=Integration.AdminModules()
.enable_mailer()
))
)
from aquilia.mail import send_mail
send_mail(
subject="Hello",
body="World",
to=["user@example.com"],
)
from aquilia.mail import asend_mail
await asend_mail(
subject="Hello",
body="World",
to=["user@example.com"],
)
from aquilia.mail import TemplateMessage
msg = TemplateMessage(
template="welcome.aqt",
context={"user": {"name": "Asha"}},
to=["asha@example.com"],
)
await msg.asend()
from aquilia.mail import EmailMessage
msg = EmailMessage(
subject="Report",
body="Attached",
to=["admin@example.com"],
)
msg.attach("report.pdf", data, "application/pdf")
msg.attach_file("/tmp/invoice.pdf")
await msg.asend()
from aquilia.mail import EmailMultiAlternatives
msg = EmailMultiAlternatives(
subject="Newsletter",
body="Plain text fallback",
to=["sub@example.com"],
)
msg.attach_alternative(html, "text/html")
await msg.asend()
from aquilia.mail import EmailMessage
from aquilia.mail import Priority
msg = EmailMessage(
subject="Critical Alert",
body="Server down!",
to=["ops@example.com"],
priority=Priority.CRITICAL.value,
idempotency_key="alert-server-1",
)
await msg.asend()
{{ d }}
<< user.name >>
<< order.total >>
<< company.logo_url >>
<< name | title >>
<< price | currency("USD") >>
<< bio | truncate(120) >>
<< n | trim | upper >>
<< user.name >>
HTML-escaped by default
<< html_fragment | safe >>
opt out (trusted markup only)
Not supported.
ATS renders expressions and
filters only. A template using
[[% if %]] / [[% for %]] raises
MailTemplateFault — precompute
the value in Python instead.
Not supported.
Compose shared markup in Python
and pass it in as context with
the | safe filter.
| Time | To | Subject | Status | Envelope ID |
|---|---|---|---|---|
| No test emails sent in this session | ||||
Click "Run Health Check" to test connectivity to all configured providers
timeout setting. Default is 30s. Check network latency to your SMTP server. Consider using a closer region for SES/SendGrid.
rate_limit_per_min per provider or increase the global limit. SES new accounts have strict sending limits.