In-memory email queue implementing EmailQueueProtocol.
A lightweight, single-process queued-sending mode: queue-email! enqueues,
process-queue! drains one entry through the wrapped sender, with bounded
retry (failed sends are re-queued up to :max-retries times). Backed by a
thread-safe ConcurrentLinkedDeque.
For distributed queuing across replicas use jobs-integration (jobs module)
instead — this adapter's state is per-process and lost on restart.
In-memory email queue implementing `EmailQueueProtocol`. A lightweight, single-process queued-sending mode: `queue-email!` enqueues, `process-queue!` drains one entry through the wrapped sender, with bounded retry (failed sends are re-queued up to `:max-retries` times). Backed by a thread-safe `ConcurrentLinkedDeque`. For distributed queuing across replicas use `jobs-integration` (jobs module) instead — this adapter's state is per-process and lost on restart.
SMTP email adapter — delegates raw transport to libs/external SmtpProviderAdapter.
This adapter sits at the boundary between the email library's domain model (Email with :id, :created-at, :attachments, :metadata) and the external library's transport layer (OutboundEmail). It translates between the two and delegates all javax.mail work to boundary.external.shell.adapters.smtp.
Responsibility split: libs/email — Email domain model, validation, preparation, job queuing libs/external — Raw SMTP transport (javax.mail, TLS/SSL, HTML multipart)
Usage: (def sender (create-smtp-sender {:host "smtp.gmail.com" :port 587 :username "user@gmail.com" :password "app-password" :tls? true})) (send-email! sender prepared-email)
SMTP email adapter — delegates raw transport to libs/external SmtpProviderAdapter.
This adapter sits at the boundary between the email library's domain model
(Email with :id, :created-at, :attachments, :metadata) and the external
library's transport layer (OutboundEmail). It translates between the two and
delegates all javax.mail work to boundary.external.shell.adapters.smtp.
Responsibility split:
libs/email — Email domain model, validation, preparation, job queuing
libs/external — Raw SMTP transport (javax.mail, TLS/SSL, HTML multipart)
Usage:
(def sender (create-smtp-sender
{:host "smtp.gmail.com"
:port 587
:username "user@gmail.com"
:password "app-password"
:tls? true}))
(send-email! sender prepared-email)Optional integration with jobs module for async email sending.
This namespace provides async email sending via the jobs module. The jobs module is an OPTIONAL dependency - add it to your deps.edn:
{:deps {org.boundary-app/boundary-jobs {:mvn/version "0.1.0"}}}
If jobs module is not available, async functions will throw descriptive errors with :type :missing-dependency.
Usage: ;; Queue email for async sending (queue-email-job! job-queue email-sender prepared-email)
;; Register email job handler with jobs module (register-email-job-handler! job-registry)
The job handler will:
Optional integration with jobs module for async email sending.
This namespace provides async email sending via the jobs module.
The jobs module is an OPTIONAL dependency - add it to your deps.edn:
{:deps {org.boundary-app/boundary-jobs {:mvn/version "0.1.0"}}}
If jobs module is not available, async functions will throw descriptive errors
with :type :missing-dependency.
Usage:
;; Queue email for async sending
(queue-email-job! job-queue email-sender prepared-email)
;; Register email job handler with jobs module
(register-email-job-handler! job-registry)
The job handler will:
- Create a new SMTP sender from config stored in job args
- Send the email using that sender
- Return job result map with :success? and :result or :errorIntegrant lifecycle for the email module.
Config keys:
:boundary/email {:provider :smtp :host "..." :port 587 :username "..." :password "..."} {:provider :logging} ; dev — logs instead of sending
Returns an EmailSenderProtocol implementation.
:boundary/email-queue {:sender (ig/ref :boundary/email) :max-retries 3}
Returns an EmailQueueProtocol implementation (in-memory, single-process).
Integrant lifecycle for the email module.
Config keys:
:boundary/email
{:provider :smtp :host "..." :port 587 :username "..." :password "..."}
{:provider :logging} ; dev — logs instead of sending
Returns an EmailSenderProtocol implementation.
:boundary/email-queue
{:sender (ig/ref :boundary/email) :max-retries 3}
Returns an EmailQueueProtocol implementation (in-memory, single-process).No vars found in this namespace.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |