docs(web/guides): fix mailer pattern in sending-email guide to use Global.cfc factory - #3098
Closed
wheels-bot[bot] wants to merge 1 commit into
Closed
Conversation
…obal.cfc factory Signed-off-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Contributor
Author
There was a problem hiding this comment.
Wheels Bot — Reviewer
TL;DR: This PR fixes the sending-email guide's broken mailer pattern — replacing new wheels.Controller().sendEmail() (which throws on every engine because a bare instance has no variables.params) with the supported new wheels.Global().controller(name, params) factory — and adds an explanatory <Aside>. I verified every technical claim against the framework source and found no blocking issues. Verdict: approve (submitted as a comment review because the PR author and this reviewer are the same bot account, and GitHub rejects self-approval).
Verified claims (evidence)
- Root cause is real.
vendor/wheels/controller/rendering.cfc:575declaresstring $controllerName = variables.params.controlleras a default argument expression in$generateIncludeTemplatePath(), whichsendEmail()reaches via$renderView()even with an absolutetemplate=path. A barenew wheels.Controller()never populatesvariables.params, so the old sample throws exactly as described in #3078. - The replacement pattern is the supported factory.
vendor/wheels/Global.cfc:1209—public any function controller(required string name, struct params = {})— and whenparamsis non-empty it returns$createControllerObject(arguments.params), a fully initialized instance (Global.cfc:1226-1228,Controller.cfc:13-25). name="UserMailer"is safe without a controller file.$objectFileName()falls back to the baseControllerclass whenapp/controllers/UserMailer.cfcdoesn't exist (vendor/wheels/Global.cfc:1076-1077— "by default we return Model or Controller so that the base component gets loaded"), so the sample won't throw a missing-component error.<Aside>renders. The MDX file already imports it (line 9:import { Aside, CardGrid, LinkCard } from '@astrojs/starlight/components';), and the new note matches the four existing<Aside>usages in the file.
Docs
- Changelog fragment present and correctly shaped:
changelog.d/3078-sending-email-guide-mailer-factory.fixed.md(.fixed.mdtype, complete bullet line) — no directCHANGELOG.mdedit. ✓
Commits
- Single commit
docs(web/guides): fix mailer pattern in sending-email guide to use Global.cfc factory— valid type, subject under 100 chars, DCO sign-off present. ✓
Non-blocking note
- "Fixes #3078" will close the issue, whose title also floats the alternative of hardening
$renderViewfor out-of-request senders. The issue's own wording is "fix docs and/or harden", so a docs-only resolution is in scope — but if a maintainer wants the framework-side hardening too, it should be spun off into a follow-up issue before this merges and auto-closes #3078.
No correctness, cross-engine, security, convention, or commitlint findings. Clean docs fix, accurately evidenced.
Collaborator
bpamiri
deleted the
docs/bot-3078-sending-email-guide-s-mailer-pattern-new-wheels-co
branch
June 12, 2026 14:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The "Organize sends in
app/mailers/" section ofsending-email.mdxshowednew wheels.Controller().sendEmail()as the mailer pattern. A barenew wheels.Controller()skips the framework's initialization path and leaves the instance withoutvariables.params, whichsendEmail()→$renderView()references in its default argument expressions — throwing on every supported engine (Component [wheels.Controller] has no accessible Member with name [PARAMS]on Lucee 7;Element PARAMS is undefinedon Adobe 2023). This PR replaces bothUserMailermethods withnew wheels.Global().controller(name=..., params={...}).sendEmail(), the supported factory that fully wires up the instance, and adds an<Aside>warning so the correct vs incorrect pattern is explicit.Fixes #3078
Screenshots needed
None — this is a prose and code-sample change only.