Push a custom template
A push sends one of your custom templates to EdgeKit as a template
bundle. EdgeKit checks it, stores it, and makes it the draft version of custom:<name>. A push never changes what
your editions send. A deploy does.
edgekit templates push --tier prodWho can push
Section titled “Who can push”Pushing needs the template:write permission. The Owner, Admin and Developer roles have it. The Editor and Member
roles do not, because a template is code that runs in every send of every publication that uses it.
A console API key can carry template:write, so a build can push. The CLI sends the first credential it finds:
CONSOLE_API_KEY, then EDGEKIT_TOKEN, then the CLI session for the organization edgekit.yaml names, or, when
the repository has no edgekit.yaml, the CLI session you selected with edgekit use. The template goes to that
credential’s organization: the key’s own, or the session’s. There is no --tenant, as for the
deploy commands.
What a push checks
Section titled “What a push checks”EdgeKit runs these checks in order. The first three stop the push before any fixture renders.
- Size: the template bundle is at most 5 MB (5,242,880 bytes).
- The name: up to 64 lowercase letters, digits and hyphens, starting and ending with a letter or a digit.
- The manifest: the name given to
defineTemplateis the name you push, the template is on a contract EdgeKit runs (1 or 2), and it lists at least one locale. Each locale is a canonical language tag, such asenoren-GB.en_GBandENare refused.fixtureProps, when set, are plain JSON (noDate,NaNorundefined) of at most 16 KB.blocks, when set, lists at most 50 keys, each one of EdgeKit’s blocks.adTypes, when set, lists each key once, each a lowercase letter, then lowercase letters, digits and hyphens, and only on contract 2. - Every fixture, in every locale the template lists: EdgeKit renders the five
fixtures,
creativesonly with the creatives of the ad types the template lists inadTypes, and thestackfixture when the template declaresblocks, with the render limits that apply to a send, then finishes each render twice, as an email and as a web archive page, exactly as a send does. Each render gets thefixturePropsyou givedefineTemplate, or{}when you give none, so a template with a required prop sets them. A check fails when:- your template’s
propsvalidator refuses those props, which stops the push before any fixture renders; - the email has no unsubscribe link;
- the HTML holds an EdgeKit token that does not exist, has the wrong arguments, or belongs to EdgeKit’s own templates, such as a personalised slot’s;
- a
{{or{%is inside<style>; - the finished HTML is over 1 MB;
- the HTML or its plain text does not parse as Braze Liquid;
- the template answers a slot position that is not in the edition;
- the template throws, or goes over a render limit.
- your template’s
Size gives a warning, never a refusal. EdgeKit measures the email as a send’s checks do: its bytes, plus about 300 bytes for each web link, which click tracking adds. It warns from 90 KB, close to Gmail’s limit. Over 102 KB, Gmail cuts the message and shows the rest behind a link. Over 400 KB, Braze will not take the email. The edition preview and its checks warn at the same sizes.
When a push is refused
Section titled “When a push is refused”A refused push stores nothing and records no version, and the draft stays as it was. The CLI prints one sentence for
the push. When checks failed, it prints one more line per failed check, which names the fixture, the form (email
or web) and the locale, then what failed. Fix every one and push again.
| Sentence | Cause |
|---|---|
The template bundle is 5,300,000 bytes, over the 5 MB limit of 5,242,880. |
The build is too large. |
"Daily_Digest" is not a template name: use up to 64 lowercase letters, digits and hyphens, … |
The name breaks the rule above. |
The template failed push validation on 4 checks. |
One line follows for each failed check. |
The template bundle is named "daily", not "digest": its defineTemplate name must be the name it is pushed as. |
templates/digest/ exports defineTemplate({ name: 'daily' }). |
The template bundle is on contract 3, and EdgeKit runs contracts 1, 2. |
The template was built with an SDK major EdgeKit does not run. |
The template bundle is on contract 1, whose support ended on 2027-11-07 UTC: … |
Its contract’s support has ended. |
The template bundle lists "en_GB", which is not a canonical language tag such as "en" or "en-GB". |
A locale is misspelled. |
The template's manifest returned a malformed result. |
fixtureProps or blocks breaks the manifest rule above. |
The template bundle declares the block "hero", which is not one of EdgeKit's: rich-text, story-list-hero, … |
A key in blocks is not one of EdgeKit’s blocks. |
The template bundle declares the ad type "Spotlight", which is not a key: … |
A key in adTypes breaks the key rule. |
The template bundle declares the ad type "banner" twice. |
A key is listed twice in adTypes. |
The template bundle declares adTypes on contract 1, which renders no creative: … |
adTypes on a template built with 1.x. |
Every fixture renders with defineTemplate's fixtureProps, {} when it sets none, and the template refuses … |
A required prop with no fixtureProps to fill it. |
Fixture "slotKinds" (email, en): An email needs EdgeKit's unsubscribe link, and the template rendered none. |
The template has no <Unsubscribe>. |
Fixture "emptySlots" (en): The template threw: "…". |
The template failed on a slot with no content. |
Fixture "maximal" (en): The template did not render within 10 seconds. |
The template is too slow. |
Fixture "maximal" (web, en): The template put a Liquid delimiter inside <style>. |
A {{ or {% in your CSS. |
Fixture "maximal" (email, en): The template's finished HTML is over the 1 MB limit. |
The email is too large once EdgeKit fills in its placeholders. |
Fixture "slotKinds" (email, en): A custom template cannot render a personalised slot. |
The template writes a token only EdgeKit’s templates may. |
EdgeKit could not run the template to check it, so nothing was pushed: push again. |
A temporary failure on EdgeKit’s side. |
EdgeKit could not store the template bundle, so nothing was pushed: push again. |
A temporary failure on EdgeKit’s side. |
The three size warnings read like this:
Fixture "maximal" (en): the email is about 95 KB with click tracking, close to Gmail's 102 KB clip.Fixture "maximal" (en): the email is about 120 KB with click tracking, over Gmail's 102 KB clip, so Gmail hides the rest behind a link.Fixture "maximal" (en): the email is about 420 KB with click tracking, over 400 KB, more than Braze takes in an email body.
Variants the new version refuses
Section titled “Variants the new version refuses”Props stay on the variant, so a new version can refuse props a variant saved earlier. After every push that is not
refused, EdgeKit checks the props of each variant that names the template, active or not, on every publication that
is not archived, with the pushed version’s own props validator. The CLI prints one line for each variant it
refuses, with the publication, the variant and the validator’s message:
Pushed digest: version 3f9a2c41d07e is now the draft's. `edgekit deploy diff` shows it before a deploy makes it active. Morning Briefing / Main: Template "custom:digest" refused its props: ctaUrl — Invalid input: expected string, received undefined.The push still succeeds. Fix the props, or the template, before a deploy makes this version active: from then on, a
send of each listed variant fails. edgekit deploy diff lists the same variants under the version the deploy
activates, and Checks warns on each one in the edition editor.
Pushing the same bytes again
Section titled “Pushing the same bytes again”- If the bytes are those of the template’s draft version, the push answers
unchanged. Nothing is validated, stored or recorded, and the draft does not change. The variants it refuses are still listed, and so is the contract’s support window warning. Past the contract’s end, the push is validated again and refused. - If the bytes are those of an earlier version, that version becomes the draft again. No new version is recorded. This is how you go back: push the earlier build again, then deploy.
What each version records
Section titled “What each version records”A version is one pushed template bundle. It records:
- the SHA-256 hash of its bytes, and its size;
- the name, locales and contract it declared;
- the commit and the branch the CLI read from git, or none outside a git repository;
- who pushed it: the console member, or the console API key by its name.
Versions are never deleted. Every push that changes the draft is also in your organization’s audit log as
custom_template.push, with the template, the version, its hash, the commit and the branch.
edgekit templates list prints each custom template, the hash of its draft version, and every version with its
source, newest first. Archived templates appear only with --all. Listing needs no permission: any member of the
organization, or any of its console API keys, can read it. Pushing an archived template brings it back.
Archive a template
Section titled “Archive a template”A custom template is archived, never deleted. Archive one from the CLI:
edgekit templates archive digest --tier prodOr open Messaging › Design › Templates, which lists each custom template with its draft and active versions, and choose Archive on its row. That list leaves archived templates out by default.
Archiving needs template:write, as a push does. EdgeKit refuses it while a publication that is not archived has a
variant naming the template, and the refusal names that publication:
Publication "Morning Briefing" still uses custom:digest: move its variants to another template, or archive the publication, first.It also refuses while any publication naming it, archived or not, has an edition scheduled or sending, since that edition still sends:
Publication "Morning Briefing" has an edition still to send with custom:digest: unschedule it, or let it send, first.A variant counts whether it is active or not. When the template is archived:
-
Template pickers stop offering it, and
edgekit templates listleaves it out unless you pass--all. -
The next deploy takes it out of the deployed configuration.
edgekit deploy diffshows the change. -
Every version is kept. The web archive of a publication that used it keeps serving the copies made when its editions were sent: they are never rendered again.
-
Your organization’s audit log records it as
custom_template.archive. -
An archived publication that uses it keeps its settings editable, but EdgeKit refuses to restore it until you push the template again or move its variants to another template:
This publication uses custom:digest, which is archived: push it again, or move its variants to another template, before restoring.
Archiving an archived template changes nothing. To bring one back, push it again.
From a push to a send
Section titled “From a push to a send”A push makes its version the draft’s. A deploy makes the draft’s version active, and a send renders only the active version. Until you deploy, every send keeps rendering the version that was active before.
A push from any branch moves the draft, so whoever deploys next ships it. Check edgekit deploy diff before you
deploy. Deploy and send a custom template covers the rest.