ErrorsBuilt-in services · rule
email.partial_invalid
An email template includes a partial that doesn't exist, can't be reached from it, or is given the wrong fields.
Area 16, Built-in services; not declinable; the next step is usually the agent's.
Why Jadpo refuses it
A partial is a piece several emails share, such as a button, declared as
a type with its own fields. A template includes it with
{{ include name(field: value, ...) }}, giving each field once by name,
so what the piece needs is checked where it is used. An include that
names a field the partial doesn't have, or a partial the template can't
reach, would send an email with a broken piece in it.
Jadpo won't guess which field a wrong name meant, so it refuses the include when you check, rather than when the email is sent.
What it looks like
The welcome email includes the shared button, which has a label and a
url.
shared/emails/button.jadpo:
/// A link set as a button.type Button = EmailPartial { label: Text url: Url}
domains/accounts/emails/welcome_email.html:
<p>Welcome, {{ name }}.</p>{{ include button(label: name, link: notes_link) }}
error button has no field link
--> domains/accounts/emails/welcome_email.html:2:32
|2 | {{ include button(label: name, link: notes_link) }} | ^^^^ not one of its fields
- reason
- A partial is a
type Name = EmailPartial { ... }inshared/emails/or the domain's ownemails/, its.htmland.txtbeside it; a template includes it as{{ include name(field: value, ...) }}, giving each of its fields once by name, and its locale goes with it. - next
- Remove
link:(agent) - rule
- email.
partial_ invalid - help
- https://jadpo.
dev/docs/errors/email. partial_ invalid
(agent) at the end of the next: line means your coding agent can make
the fix itself.
How to fix it
If the field has another name in the partial, give it by that name.
Button calls the link url, so in
domains/accounts/emails/welcome_email.html:
{{ include button(label: name, url: notes_link) }}The welcome email's button now links to notes_link.
A partial in another domain's emails/ can't be reached from this one.
Move it to shared/emails/, where every domain's emails may include it.
Related
Markdown for agents: /docs/errors/email.partial_invalid.md.Built from Jadpo main at aee2e8f.