New on the blog: Sending Email in Wheels 4.0 — sen...
# wheels-dev
p
New on the blog: Sending Email in Wheels 4.0 — sendEmail, Templates, and Background Delivery. <https://blog.wheels.dev/posts/sending-email-in-wheels-4/ > What it covers: •
sendEmail
is the whole mailer — no Mailer class, no ActionMailer. One controller helper that renders a view and sends it. • The arg-routing rule: a
cfmail
attribute goes to the email, everything else becomes a view variable. Get the name wrong and your reply-to silently becomes template data. • Email template resolution — bare name vs. leading-slash, and why the slash matters. • Multipart text+html and the
<
-counting heuristic that flips your parts if your text body has code in it.
detectMultipart=false
fixes it. • Attachments, and
deliver=false
as the preview/test path. • The big one: the bare
sendEmail()
inside a Job's
perform()
that the docs show does not work — a Job is a plain component with no controller mixins. The fix is
controller("Mailer").sendEmail(...)
. Full background-delivery example included.