This release is a pre-release and may not be stable for production use.
imio.recipe.emailkit
A zc.buildout recipe that gives every imio.emailkit consumer three scripts:
bin/compile-emails, bin/check-emails and bin/preview-emails.
Usage
[buildout]
parts = ... emails
[emails]
recipe = imio.recipe.emailkit
eggs = ${instance:eggs}
# compile-on-install = false (default)
# kit-mode = path | copy (default: path)
# node-bin = node (resolution: PATH by default)
The part scans eggs for distributions whose ZCML registers
<emailkit:templates>, records each one's emails//templates/ paths, and
writes the three scripts using the design kit from imio.emailkit.
A plain buildout run invokes no Node, touches no emails/ directory, and
imports no consumer code. compile-on-install opts in to compiling at
install time; default false.
Options
| Option | Default | What it does |
|---|---|---|
eggs |
required | distributions to scan; normally ${instance:eggs}. |
kit-mode |
path |
how the design kit wires into a consumer's Maizzle build. |
node-bin |
node |
the Node executable; npm/npx sit beside it. |
compile-on-install |
false |
run compile-emails as an install step. Opt-in. |
Every option is also a script flag (--kit-mode copy).
The scripts
bin/compile-emails [--package NAME] [--watch] [--new NAME]
Steps: wire the kit, npm ci if node_modules is stale, npx maizzle build, then copy the plaintext twins back in, since maizzle build empties
its output directory. Exits non-zero on failure.
--watch delegates to Maizzle's dev server, which shows build-time
output: raw ${item/title}, unexpanded tal:repeat. Use
preview-emails --watch for a real preview.
--new NAME scaffolds the four files a template needs: a .vue skeleton, a
fixture, a golden placeholder, and a registration stub. It refuses to
overwrite files without --force; the skeleton follows every authoring
rule.
bin/check-emails [--package NAME]
The CI check. Two checks:
- Staleness. Snapshot the committed
.ptfiles, build in place, diff, restore. Exit 1 with a per-file diff. Covers every.ptunder the package, not justtemplates/. - The authoring lint:
python -m imio.emailkit.lint <paths>. A missing lint module fails this check.--no-lintskips it explicitly.
--lint-only runs the authoring lint alone; no Node needed.
bin/preview-emails [--package NAME] [--watch]
Compiles and renders every template through render() with its fixture,
serving it with a language switcher and live reload.
It needs no ZODB and no zope.conf: a minimal ZCML load gives real
placeholder substitution and real FR/NL/DE translations. Two things stay
fake: portal_url is empty, and theme tokens use the kit's defaults
(override with --theme token=value). For real site branding, use
@@emailkit-preview.
--no-compile renders the committed .pt files as-is.
What a consumer addon has to do
Three things, once.
1. Lay the addon out as follows. emails/ sits inside the package or at
the checkout root; both work.
src/acme/notifications/
├── emails/ # dev only; prune it from the sdist
│ ├── package.json
│ ├── maizzle.config.js
│ ├── .kit/ # generated; ignores itself
│ ├── twins/ # hand-authored *.txt.pt, if any
│ └── src/templates/*.vue
└── templates/*.pt # committed build output
2. Write emails/maizzle.config.js against ./.kit/. Three imports and
one override. recipe/tests/consumer is a working example.
import { defineConfig } from '@maizzle/framework'
import { fileURLToPath } from 'node:url'
import { dirname, resolve } from 'node:path'
import { kitBaseConfig } from './.kit/maizzle.config.base.js'
const here = dirname(fileURLToPath(import.meta.url))
const kit = kitBaseConfig()
export default defineConfig({
...kit,
output: { ...kit.output, path: resolve(here, '..', 'templates') },
})
compile-emails materializes emails/.kit/ before every build, identical in
both modes, so a consumer's config never mentions which one. path mode
re-exports the kit from the installed egg (zero-copy); copy mode holds the
kit itself. Consumers never vendor kit files.
Do not add "type": "module" to emails/package.json: jiti must transpile
the kit file's ESM syntax, since in path mode it lives outside any npm
tree.
3. Register in ZCML and run the checks in CI:
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:emailkit="http://namespaces.imio.be/emailkit"
i18n_domain="acme.notifications"
>
<include package="imio.emailkit" file="meta.zcml" />
<emailkit:templates>
<emailkit:template name="welcome" subject="[email_subject_welcome] Welcome" />
</emailkit:templates>
</configure>
bin/check-emails --package acme.notifications
kit-mode: which one?
Use path unless something forces you off it: zero-copy, and it cannot go
stale. copy is a verified, byte-identical fallback, for when Maizzle or
packaging stops resolving files outside the npm tree.
Development
This distribution is a sibling directory in the imio.emailkit repository,
released separately. Its tests run in two environments: no single one has
both buildout and the Plone runtime.
make recipe-test # both runs; the union covers every test
make buildout-test # the full buildout acceptance test, end to end
make buildout-clean # remove everything that writes
test-buildout.cfg at the repository root is the harness. test-buildout-pypi.cfg
is the same thing resolving from PyPI — the literal "git clone && buildout".
Metadata
Release files for imio.recipe.emailkit 1.0.0b6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| imio_recipe_emailkit-1.0.0b6.tar.gz | 56.2 kB | Without provenance | Details for imio_recipe_emailkit-1.0.0b6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| imio_recipe_emailkit-1.0.0b6-py3-none-any.whl | Python 3 | none | any | Details for imio_recipe_emailkit-1.0.0b6-py3-none-any.whl |
Total release size: 101.9 kB
Release files / imio_recipe_emailkit-1.0.0b6.tar.gz
| Download URL | imio_recipe_emailkit-1.0.0b6.tar.gz |
|---|---|
| Size | 56.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b0bdf0180b64dfb1f9291b42fe15bd1a19aad2c143b2d0554455b0d87e8fc24f
|
|
BLAKE2b-256 checksum How to use checksums |
97401cb6c1cd662e65262f50bb213785143e4f89ed2c0e36607648972f5ab7cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / imio_recipe_emailkit-1.0.0b6-py3-none-any.whl
| Download URL | imio_recipe_emailkit-1.0.0b6-py3-none-any.whl |
|---|---|
| Size | 45.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cc11c0fc977216d65187ae9319f97fd7b3278d0b9ba3a84ac8cfe69fb6de2d69
|
|
BLAKE2b-256 checksum How to use checksums |
e117ccf63312010ec837580303feaec505992fcb6e89ca262d3b051f8747fd2f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Security for imio.recipe.emailkit 1.0.0b6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.