Build HTML email templates for HubSpot. Use when the user wants to create, edit, or troubleshoot HubSpot email templates. Also use when the user mentions 'HubSpot email,' 'email template,' 'HubL email,' or 'email HTML.' For email sequences and drip campaigns, see email-sequence. For CTA buttons, see hubspot-cta.
Build HTML email templates for HubSpot. Use when the user wants to create, edit, or troubleshoot HubSpot email templates. Also use when the user mentions 'HubSpot email,' 'email template,' 'HubL email,' or 'email HTML.' For email sequences and drip campaigns, see email-sequence. For CTA buttons, see hubspot-cta.
HubSpot Email Templates
You are an expert email developer creating HTML email templates for upload to HubSpot. Every template must follow HubSpot's technical constraints, email client compatibility rules, and the brand system.
Scope boundary — pull two web-design reference files for email. Email HTML has different constraints than web (table-based layout, 600px max, no JS, limited CSS, no hover on many clients), so don't load all of web-design. But two of its reference files apply directly and should be loaded alongside this skill for any email build or review:
.claude/skills/web-design/references/accessibility.md — semantic HTML, alt text, contrast (brand palette), reading order, reduced-motion. Email a11y matters and this covers the gaps brand-guide doesn't.
.claude/skills/web-design/references/anti-patterns.md — brand-specific bans (no gradient accent lines, no pill shapes, no "kernel-level" copy, purple-as-default-CTA-for-email justification, no three-color gradient on non-text surfaces). All apply to email.
Skip web-design's interaction/motion/responsive/composition/state files — those assume a live web environment. Switch fully to web-design only when the CTA destination or thank-you page needs craft review.
Before Building
Always read these first:
/brain/brand-guide/brand-guide.md — colors, typography, spacing, brand system
This skill file — HubSpot constraints and email HTML rules
If the email includes product claims or copy:
Read /brain/truth.md and /brain/positioning-and-messaging.md to ensure accuracy. Never invent product facts.
Gather this context (ask if not provided):
1. Email Type
What kind of email? (webinar promotion, product announcement, newsletter, event invite, nurture, other)
Is this a one-off or a reusable template with editable placeholders?
2. Content
What is the primary message?
Any supporting content (bullets, speaker bios, dates, CTAs)?
How many CTAs? What action(s)?
3. Upload Method
AI Upload (paste HTML, HubSpot recreates in drag-and-drop) — more limitations
Coded Template (Design Manager, full HubL support) — more control
Default to AI Upload constraints (strictest) unless told otherwise
HubSpot AI Upload Limitations
When creating templates for HubSpot's "Upload external email template" feature, these elements will not transfer:
Limitation
Impact
Workaround
Max width 600px
Container must be 600px or narrower
Always use 600px container
No background gradients
CSS linear-gradient on backgrounds is stripped
Use solid background colors. Apply gradients only as accent images or via the gradient bar as an <img> if needed
No rounded corners on modules
border-radius on outer module wrappers won't transfer via AI Upload
Remove radius from large containers (cards, banner wrappers). Small inline elements like buttons and tags can keep border-radius — these work fine. For full radius support, use a coded template via Content > Design Manager (HTML + HubL, type Email) instead of AI Upload
No overlapping elements
Text over images, absolute positioning stripped
Use stacked layout — image block, then text block. No layered compositions
No custom fonts
Custom @import or @font-face ignored
Use system-safe font stacks. Inter won't render — fall back to Arial, Helvetica, sans-serif
No custom modules
HubSpot-specific modules won't transfer
Use standard HTML tables and content blocks
Images must be publicly hosted
Local or private image URLs won't load
Use publicly accessible URLs (e.g., from your website, CDN, or HubSpot File Manager)
No JavaScript
All <script> tags stripped
Never include JS — it's stripped by all email clients anyway
No CSS positioning
position: absolute/fixed/relative not supported
Use table-based layout exclusively
No CSS floats
float property unreliable in email
Use table cells for side-by-side layouts
No external stylesheets
<link rel="stylesheet"> won't load
All CSS must be inline or in <style> in <head>
filter CSS property
Not supported in most email clients
Don't use filter: invert() etc. — use pre-made white icon assets instead
Social module icons
Platform-specific social icons (Pinterest, Snapchat) not supported
Use simple image icons with links
What DOES Transfer Well
Table-based layouts
Inline styles
Solid background colors
Standard images (publicly hosted)
Text formatting (bold, italic, size, color)
Links and buttons (with inline styles)
Basic <style> block in <head> (HubSpot inlines it)
Media queries in a separate<style> block (for responsive)
HubSpot Coded Template Requirements
When building templates for upload via Design Manager (coded templates), follow these requirements.
Template Annotations (Design Manager)
Every coded email template file must start with template annotations as an HTML comment before the DOCTYPE:
templateType: email — tells Design Manager this is an email template
isAvailableForNewContent: true — makes it selectable when creating new emails
label — display name in the template picker
HubL Editable Fields
Use these HubL tags to create editable fields that appear in the email editor sidebar:
{# Editable text — use for short fields (titles, names, dates, URLs) #}
{% text "field_id" label="Field Label", value="Default value", no_wrapper=True %}
{# Editable rich text — use for paragraphs, formatted content #}
{% rich_text "field_id" label="Field Label", html="<p>Default content</p>", no_wrapper=True %}
{# Boolean toggle — use to show/hide sections #}
{% boolean "field_id" label="Show Section", value=True, export_to_template_context=True %}
{# Module — use for HubSpot-managed email modules #}
{% module "module_id" path="@hubspot/email_cta" %}
Important: Always use no_wrapper=True when placing {% text %} or {% rich_text %} inside styled containers. Without it, HubSpot adds wrapper <div> or <span> elements that break inline styling.
Important: For {% boolean %} tags, use export_to_template_context=True instead of no_wrapper=True. Without it, the boolean renders "true" or "false" as visible text in the email body. export_to_template_context=True stores the value silently and makes it available via widget_data.field_id.value.
Conditional sections with boolean:
{% boolean "show_section" label="Show Section", value=True, export_to_template_context=True %}
{% if widget_data.show_section.value %}
<!-- HTML for the conditional section -->
{% endif %}
Personalization Token — Greeting Pattern
When using a personalization token for greetings (e.g., "Hi {{first_name}},"), always set the fallback value to "there" in HubSpot's token picker UI. This produces:
With name: "Hi Rita,"
Without name: "Hi there,"
Do NOT leave the fallback blank or use a space. HubSpot's UI requires a fallback value — an empty field or a space creates awkward rendering ("Hi ," or "Hi ,"). The word "there" is the established pattern for all [Company] emails.
When inserting via the HubSpot rich text editor: type "Hi ", click Insert > Personalization, select Contact > First Name, set fallback to "there", then type "," after the token.
For the coded template equivalent:
Hi {% personalization_token "contact.firstname", "there" %},
Default Email Modules Reference
Email modules are different from web page modules. Use @hubspot/email_cta not @hubspot/cta, @hubspot/email_text not @hubspot/text, etc.
Module
Path
Use For
Call-to-Action
@hubspot/email_cta
HubSpot-managed CTA (renders its own markup)
Main Email Body
@hubspot/email_body
Primary email content (rich text)
Logo
@hubspot/email_logo
Company logo (pulls from account settings)
Image
@hubspot/image_email
Standalone image
Linked Image
@hubspot/email_linked_image
Image with link
Header
@hubspot/email_header
Heading (h1-h6)
Text
@hubspot/email_text
Single line of text
Section Header
@hubspot/email_section_header
Header + subheader
CAN-SPAM Footer
@hubspot/email_can_spam
Auto-populated business address + unsubscribe
Social Sharing
@hubspot/email_social_sharing
Social share buttons
Raw HTML
@hubspot/raw_html_email
Custom HTML block
Video
@hubspot/video_email
Video embed with thumbnail
Blog Post Filter
@hubspot/email_post_filter
Blog post filter by tag/author/month
Blog Post Listing
@hubspot/email_post_listing
Recent/popular blog posts
Subscriptions
@hubspot/email_subscriptions
Subscription preferences page
Subscription Confirmation
@hubspot/email_subscriptions_confirmation
Subscription change confirmation
Unsubscribe (Backup)
@hubspot/email_simple_subscription
Simple unsubscribe form
IMPORTANT: @hubspot/rich_text_email does NOT exist. There is no email-specific rich text module. For rich text / HTML content in email templates, use @hubspot/email_body (accepts html parameter for default content). The web module @hubspot/rich_text is NOT in HubSpot's "replace for email" list, so it may also work, but @hubspot/email_body is the confirmed email-native option.
CTA Buttons in Email Templates
IMPORTANT: {% cta %} does NOT work in HubSpot marketing emails. The {% cta %} HubL tag is for web/landing pages only. Using it in an email template causes a "There was a problem loading this content" error in the email editor sidebar. This was confirmed by HubSpot support.
Recommended Approach: @hubspot/email_cta Module
Use the native CTA module. It renders correctly in the email editor, gives the marketer a proper CTA picker, and tracks clicks in the CTA dashboard.
Do NOT wrap this in a <div>. HubSpot's {% module %} generates its own wrapper markup (<div id="hs_cos_wrapper_cta">). Adding a parent div hides the module entirely in the email editor.
Centering and spacing: Target the wrapper ID in the non-inlined style block (the one WITHOUT id="hs-inline-css"). Do NOT put it in the hs-inline-css block — HubSpot inlines those styles before the module wrapper exists, so they have nothing to attach to.
<!-- Non-inlined styles — HubSpot keeps these as <style> in <head> --><styletype="text/css">/* Center the CTA module wrapper and its inner table */#hs_cos_wrapper_cta { text-align: center; padding: 16px24px024px; }
#hs_cos_wrapper_ctatable { margin: 0 auto; }
</style>
Why this works: The non-inlined <style> block stays in the <head> as a CSS rule. At render time, the module wrapper exists and the rules apply. text-align: center centers inline content; margin: 0 auto on the inner table centers block-level content. Works in Gmail, Apple Mail, iOS, and most modern clients. Outlook may ignore the <style> block (button still renders, just left-aligned).
Brand colors: Marketer sets #6A2AFF bg, #F9F9F9 text, 12px radius in the CTA editor's Styles tab. Purple is the approved default for email CTAs (teal #50F6E8 renders inconsistently across email clients — Outlook, dark-mode Gmail, and forwarded chains can shift it). Both teal and purple are approved primary button colors per brain/brand-guide/brand-guide.md — use teal on landing pages where contrast is reliable, purple in email where it is not.
What you get: CTA dashboard tracking (views, clicks, conversions), native "Link to: CTA" picker, marketer controls styling via editor UI.
What you don't get: Pixel-perfect brand CSS from the template — marketer sets brand colors manually per-email.
Comparison
Approach
Brand Control
CTA Dashboard
Editor UX
@hubspot/email_cta module (recommended)
Marketer sets in Styles tab
Yes — views, clicks, conversions
Native CTA picker + style editor
Styled <a> + {% text %}
Full inline CSS
Per-email only
Breaks in Remix editor — HubSpot auto-converts to broken module
{% cta %} tag
N/A
N/A
Does not work in emails — page-only tag
Drag-and-Drop (dnd_area) Email Templates
HubSpot's email editor (Remix) always uses a drag-and-drop interface. Even coded templates get auto-converted to dnd modules — and the conversion often breaks (producing "Unknown Module" or uneditable modules). The fix: use {% dnd_area %} tags to control how HubSpot builds the module tree.
When to Use dnd_area
Choose between classic HubL and dnd_area based on who controls the layout.
Classic HubL ({% text %}, {% rich_text %}, {% boolean %}): template author locks the structure, marketers only fill in labelled fields. Use this for brand-critical recurring templates (newsletters, promos, announcements) where design consistency matters more than layout flexibility. All current [Company] production templates (email-base-hubspot.html, livestream-email.html, livestream-compact-email.html, on-demand-followup-email.html, newsletter-monthly-email.html) use classic HubL and render correctly in the Remix email editor.
dnd_area: template author provides a starter layout, marketers drag/drop/reorder modules per send. Use when different issues need different structures, or when multiple non-technical marketers need layout flexibility without touching code.
For a single-marketer workflow with tight design control ([Company] today), classic HubL is usually the right default. Reach for dnd_area when layout flexibility per send is more valuable than brand-lockdown consistency.
The bug: In a template mixing a static masthead/footer with a dnd_area, the dnd module content renders ~10px to the right of the static sections — even when both use the same internal padding (e.g. padding: 0 40px). Visible as a misaligned divider/separator line or an off-axis share-row box.
Why it happens: HubSpot's dnd_area_stylesheet (injected via {{ dnd_area_stylesheet }}) adds default horizontal padding to the .dnd-section / .dnd-column / .dnd-module wrappers it generates. Those wrappers sit between your email-container <td> and your module's HTML, so the effective left offset of module content is (module internal padding) + (wrapper padding), while static masthead/footer content is just (td padding).
What does NOT fix it (tried and failed on the Mind the Gap build, 2026-04-22):
padding={'top':0,'bottom':0,'left':0,'right':0} on dnd_section / dnd_column
hs_wrapper_css={'padding':'0'} on every dnd_module
full_width=False on dnd_area and dnd_section (still a good idea for other reasons, but doesn't fix the offset)
A <style> block in the template <head> with !important overrides on .dnd-section / .dnd-column / .dnd-module — HubSpot's stylesheet injection wins the specificity war somehow.
What DOES fix it — adjust the static sections, not the dnd wrappers. Measure the offset live in devtools (in the company's case: ~10px), then bump the left (and usually right) padding on every static <td> by that amount so it aligns with the module content. The dnd wrapper's offset is fixed — you match it from the static side.
Concrete pattern that worked for Mind the Gap (modules use 40px internal L/R padding, wrapper adds ~10px each side):
<!-- Masthead: left 50 (not 40) to match dnd module content --><tdstyle="padding: 48px 40px 32px 50px;">...masthead...</td><!-- Share row: 50 L and R so the box aligns with module content both sides --><tdstyle="padding: 48px 50px 0 50px;"><div>...share box...</div></td><!-- Footer divider: 50 L and R so the line matches module dividers --><tdstyle="padding: 32px 50px 0 50px;"><divstyle="border-top: 1px solid #E5E7EB;"> </div></td>
Rule of thumb: don't fight HubSpot's dnd wrapper. Measure the offset once, then pad the static sections to match. This keeps all the module padding logic untouched and doesn't rely on CSS override tricks that don't actually work.
Module Paths for dnd Email
Only use modules confirmed to work in dnd email context:
Module
Path
Works in dnd email
CTA Button
@hubspot/email_cta
Confirmed
Image
@hubspot/image_email
Confirmed (in official docs)
Email Body (rich text)
@hubspot/email_body
Testing
Raw HTML
@hubspot/raw_html_email
Testing
One line of text
@hubspot/email_text
Testing
Do NOT use @hubspot/rich_text_email — this path does not exist and produces "Unknown Module" errors.
<!-- Unsubscribe --><adata-unsubscribe="true"href="{{ unsubscribe_link }}">Unsubscribe</a><!-- Unsubscribe from all --><adata-unsubscribe="true"href="{{ unsubscribe_link_all }}">Unsubscribe from all</a><!-- View as webpage --><adata-viewaswebpage="true"href="{{ view_as_page_url }}">View as web page</a>
Preview Text
<divid="preview_text"style="display:none!important;">
{% text "preview_text" label="Preview Text" value="Preview text here" %}
</div>
CSS Inlining
Use id="hs-inline-css" on style blocks that should be compiled to inline CSS:
<styletype="text/css"id="hs-inline-css">/* These styles will be inlined on target elements */td { font-family: Arial, sans-serif; }
</style>
Keep media queries in a separate<style> block (without the inline ID) so they aren't inlined:
Gmail App on iOS is a massive platform and the hardest dark mode problem in email. Read this before building any dark-themed email template.
How Gmail iOS dark mode works:
Gmail applies a proprietary color inversion algorithm to emails — it modifies BOTH backgrounds AND text colors
It targets: background-color CSS, bgcolor HTML attributes, color CSS, and <font color=""> tags
There is no opt-out. No meta tag, CSS property, or HTML attribute reliably prevents Gmail iOS from modifying colors
@media (prefers-color-scheme: dark) is ignored by Gmail iOS (works in Gmail Web only)
color-scheme / supported-color-schemes meta tags have no effect on Gmail iOS
What Gmail iOS does NOT touch:
background-image (including linear-gradient()) — this is the only known way to preserve a background color
Actual images (<img> tags) — these render as-is
Techniques we tested and their results (Session 31):
Technique
Fixes Backgrounds?
Fixes Text?
Verdict
color-scheme meta tags
No
No
Useless for Gmail iOS
bgcolor on <table>/<td>
No
N/A
Gmail inverts these too
background-image: linear-gradient(#color, #color)
Yes
No
Only reliable background fix
<font color=""> tags
N/A
No
Gmail overrides them
@media (prefers-color-scheme: dark)
N/A
N/A
Gmail iOS ignores entirely
The core problem for dark-themed emails: You can preserve dark backgrounds with the gradient hack, but Gmail will still mute/shift all text colors. The result is dark background + washed-out text — which can look worse than letting Gmail do its full inversion (where at least backgrounds and text have consistent contrast).
Recommendation:
Do not build dark-themed email templates expecting pixel-perfect rendering in Gmail iOS dark mode. It will not happen.
If you build a dark email, accept that Gmail iOS users will see a color-shifted version. Test in HubSpot's "Preview in email client" → Gmail App Dark (iOS 18) to verify it's at least readable.
Consider whether a light-themed template would serve better if Gmail iOS is a priority audience.
Do NOT add background-image gradient hacks, <font> tags, or color-scheme meta tags to "fix" Gmail dark mode — we tested all of these and none produce an acceptable result for dark emails. They create partial fixes that look worse than Gmail's native full inversion.
Full investigation documented at:marketing/plans/gmail-ios-dark-mode-fix.md
Dark Mode — Other Clients
Apple Mail: Respects @media (prefers-color-scheme: dark) and color-scheme meta — progressive enhancement works here
Outlook.com / Outlook mobile: Uses [data-ogsc] (text color) and [data-ogsb] (background color) attributes when forcing dark mode. These are Outlook-specific, not Gmail.
Transparent PNGs may become invisible on inverted backgrounds — use solid-background versions or test carefully
For clients that support it, color-scheme: light dark; in CSS is fine as progressive enhancement — just know it does nothing for Gmail iOS
Outlook Specific
Outlook uses Word as its rendering engine — most CSS is ignored
Use <!--[if mso]> conditional comments for Outlook-specific fixes
MSO properties (mso-table-lspace, mso-padding-alt, etc.) are valid for Outlook only
border-radius does not work in Outlook — buttons degrade to rectangular
Background images don't work in Outlook without VML (Vector Markup Language) hacks
[Company] Brand Adaptation for Email
Since email clients have limited CSS support, adapt the brand system:
Brand Element
Website
Email Adaptation
Background
#0F0F0F
#0F0F0F — works in email
Font
Inter
Arial, Helvetica, sans-serif (with @import Inter as progressive enhancement)
Gradient accent bar
CSS linear-gradient
Use a pre-made gradient image (hosted PNG/SVG) or a thin <img> element
Gradient text
background-clip: text
Not supported — use white #F9F9F9 text instead
Purple CTA button
#6A2AFF solid
Styled <a> with {% text %} fields for URL and copy (see CTA section above)
Cyan tag
#50F6E8 bg, #0F0F0F text
Works with inline styles
Card surfaces
#131313 with border-radius: 32px
Use #131313 bg. Radius works except Outlook (graceful degradation)
Border
1px solid #454545
Works inline on <td>
Social icons
CSS filter: invert()
Don't use filter. Host white icon PNGs and reference directly
Gradient Bar as Image
Since CSS gradients don't work in email backgrounds, create the signature gradient as a hosted image:
Create a 600x4px PNG with the cyan→purple→pink gradient
Host it publicly (website or HubSpot File Manager)
Reference as <img src="[gradient-bar-url]" width="600" height="4" style="display: block;" />
Base Template + Variants
All [Company] HubSpot email templates use a base template pattern. The shared foundation (header, gradient bar, CTA, footer) lives in one file, and each email type is a variant that customizes the content area.
Existing Templates
marketing/templates/email-templates/
├── email-base-hubspot.html ← Base (DO NOT upload — starting point only)
├── livestream-email.html ← Full-length livestream promo (classic coded, HubL fields)
├── livestream-compact-email.html ← Two-column compact livestream variant
└── _previews/ ← Static HTML previews (not for upload)
└── livestream-compact-preview.html
Creating a New Email Variant
Duplicate email-base-hubspot.html
Rename it (e.g., product-announcement-hubspot.html)
Base styles (id="hs-inline-css") and responsive media queries
Preview text module
What Changes Per Variant
The content area between the gradient bar and CTA
Any variant-specific responsive CSS classes (e.g., .date-col for the livestream)
The preview text default value
Template Structure
Every email template should follow this structure:
1. DOCTYPE + HTML wrapper
2. <head>
- Meta tags (charset, viewport, X-UA-Compatible)
- Outlook conditional comments (PixelsPerInch)
- <style> block with inline-css ID (base styles)
- <style> block for media queries (responsive)
3. <body> (background color on body + wrapper table)
4. Full-width wrapper table (100% width, centered)
5. Email container table (600px, centered)
a. Logo header (linked to website)
b. Content sections
c. CTA button(s)
d. Footer (social icons, copyright, unsubscribe)
6. Closing tags
Output Format
Output location:marketing/email/templates/[template-slug]/ — confirm the project slug with the user before creating files.
For Each Template, Provide:
1. Complete HTML file
Production-ready, tested against the constraints above
All styles inlined on elements
Progressive <style> block in head
Responsive media queries in separate <style> block
<!-- EDITABLE: --> comments marking content the user should replace
Placeholder brackets [like this] for variable content
2. Upload instructions
Brief notes on which upload method to use (AI Upload vs. coded template)
Any post-upload adjustments needed in HubSpot's editor
Image hosting requirements (list any images that need public URLs)
For Design Manager (coded templates):
Go to Content > Design Manager (or Marketing > Files and Templates > Design Tools)
Click File > New file
Select HTML + HubL as the file type
In "What are you building?" select Template
Click Template type and select Email
Enter a file name and click Create
Paste the complete template code
Click Publish (top right)
The template will appear in the template picker when creating new marketing emails
All HubL editable fields ({% text %}, {% rich_text %}, {% boolean %}) will appear in the right sidebar when editing an email
3. Testing checklist
Preview in HubSpot
Send test email to yourself
Check rendering in Gmail (web + mobile) — including Gmail App Dark (iOS 18) preview
Table-based layout only (no flexbox, grid, floats, positioning)
All critical styles inlined
No CSS gradients on backgrounds (use images or solid colors)
No overlapping elements
No JavaScript
No filter CSS property
Font stack includes system-safe fallbacks
All images use publicly accessible URLs
All images have alt, width, height, display: block, border: 0
Bulletproof button pattern used for CTAs
Social icons are pre-made white PNGs (not filtered)
Gmail App Dark (iOS 18) preview checked — email is readable (colors will shift, that's expected)
No transparent PNGs that become invisible on inverted backgrounds
CAN-SPAM compliant footer (unsubscribe link present)
Responsive media queries in separate <style> block
Outlook conditional comments included
Tested at 600px and mobile widths
No AI slop patterns in copy (see CLAUDE.md)
Product claims verified against /brain/truth.md
MCP Tools: HubSpot Dev, Figma & agent-browser
HubSpot Dev MCP (Documentation & CMS)
Use these tools to look up HubSpot documentation and manage CMS assets:
Search docs — Use mcp__HubSpotDev__search-docs to find HubSpot developer documentation on email modules, template markup, HubL syntax, or any email-related API. Always search before guessing at module paths or field syntax.
Fetch doc page — Use mcp__HubSpotDev__fetch-doc immediately after searching to read the full documentation page. Never skip this step — search results are summaries, not complete docs.
Create a CMS template — Use mcp__HubSpotDev__create-cms-template to scaffold a new email template file. Set templateType to email-template.
List remote contents — Use mcp__HubSpotDev__list-cms-remote-contents to see what templates and assets are already deployed in the HubSpot Design Manager.
Create a CMS module — Use mcp__HubSpotDev__create-cms-module to scaffold a custom email module if needed.
When to use: Before building any email template, search docs to verify module paths (e.g., confirm @hubspot/email_body vs @hubspot/email_text behavior). After building, use list-cms-remote-contents to check for naming conflicts before manual upload.
Figma MCP (Design Input)
When the user provides a Figma URL or references an email design mockup:
Pull design context — Use mcp__figma-remote-mcp__get_design_context to extract layout, colors, typography, and spacing from the Figma mockup. Translate these into email-safe HTML (table-based, inline styles, system fonts).
Take a screenshot — Use mcp__figma-remote-mcp__get_screenshot to see the visual design before building the template.
Get metadata — Use mcp__figma-remote-mcp__get_metadata to understand the section structure and layer hierarchy.
When to use: When the user has an email design in Figma that needs to be converted to a HubSpot-compatible HTML template. Remember: the Figma design will use features email doesn't support (gradients, custom fonts, border-radius) — adapt per the constraints in this skill.
agent-browser (Email Rendering Validation)
After building an email template, use agent-browser to validate rendering:
Open the template — Run agent-browser open <file> to open the HTML email file in the browser.
Test at email width — Run agent-browser set viewport 600 900 to set the viewport to 600px wide (email container width), then run agent-browser screenshot to capture the result.
Test mobile rendering — Run agent-browser set viewport 375 812 and run agent-browser screenshot again to verify responsive behavior.
Full-page capture — Run agent-browser screenshot to capture the entire email template for review.
Check accessibility — Run agent-browser snapshot -i to verify heading structure, link text, and alt text on images.
Console errors — Run agent-browser console to catch any broken image references or CSS issues.
When to use: After building any email template — always use agent-browser to validate in the browser before delivering. This catches layout issues, broken images, and responsive problems before the template reaches HubSpot.
Use the analytics skill to pull real email performance data when reviewing or optimizing email templates:
hubspot-emails.ts — Open rates, click rates, CTOR, bounce rates, and top-performing emails. Benchmark new templates against historical performance or identify which formats work best.
Example: Before building a new email template, run npx tsx .claude/skills/analytics/scripts/hubspot-emails.ts 90d to see which existing emails had the highest open/click rates, then apply those patterns to the new template.
Mandatory Skill Delegation
Before producing work, check whether any of these skills apply to the task. If they do, load the skill before writing that portion. Do not replicate a skill's logic from memory — load it and apply it.
Visual design decisions beyond what's in the brand guide
brand-design
Yes — load for custom visual asset work
Landing page templates (different constraints)
hubspot-landing-page
Load if the user asks about landing pages to avoid applying email constraints
Learnings
[HIGH] Light-themed emails need a non-brand link color. brand teal #50F6E8 fails WCAG AA on white (~1.4:1). Use #0D9488 (teal-600, 4.68:1 AA) for links on white backgrounds. (Session 77, 2026-04-13)
[HIGH] For newsletter/digest-style emails, use line icons from Lucide (not emoji) paired with uppercase section labels. Emoji looks dated and can't match brand voice; Lucide gives a clean, modern, TLDR-like feel. (Session 77, 2026-04-13)
[MEDIUM] Email icon workflow: download Lucide SVG from unpkg.com/lucide-static@latest/icons/{name}.svg, bake color with sed 's/stroke="currentColor"/stroke="#HEX"/', rasterize to 40×40 PNG with rsvg-convert -w 40 -h 40. Store both SVG and PNG side-by-side in marketing/icons/{category}/. (Session 77, 2026-04-13)
[HIGH] When building CTA sections in email templates, reference brain/brand-guide/brand-guide.md CTA block patterns first — don't default to a bare intro + button. Variant A (Dark Card) is typically the only brand-guide CTA pattern that translates to email; variants B/D/E rely on CSS gradient backgrounds and ambient glows that email clients strip. For light-themed emails, adapt Variant A per the brand's Light Mode Accent Strategy: white card with rgba(0,0,0,0.10) border, Tonik Blue #444AD9 outlined tag kicker, purple #6A2AFF bulletproof button. (Session 93, 2026-04-22)
[MEDIUM] For repeatable dnd custom modules (blog post, event, industry item), add a show_section_marker boolean field. Turn ON for the first item in a group, OFF for subsequent items so they stack cleanly under one marker + one leading divider. Prevents duplicate "LATEST POSTS"-style headers when the marketer drops multiple instances. (Session 93, 2026-04-22)
[MEDIUM] For recurring dnd_area newsletter templates, pre-place default dnd_module tags inside the dnd_area with realistic starter content (e.g. Featured + 2 Blog Posts + 1 Event + Dev Corner). Gives the marketer a working starting layout instead of an empty canvas. (Session 93, 2026-04-22)
[MEDIUM] Module path convention for dnd_area templates: place custom modules in a modules/ subfolder next to the template; reference as dnd_module path="./modules/name". Matches repo layout to Design Manager folder structure and makes uploads predictable. (Session 93, 2026-04-22)
[HIGH] HubSpot email template validator rejects: {% dnd_area %} with any name other than "main", class attribute on dnd_area, {% text %} tags anywhere in email templates, module field names body (use body_text) and name (use something descriptive like event_name). When HubSpot blocks a tag type for editable fields, wrap the fields in a micro custom module and include via {% module "label" path="./modules/foo" %}. (Session 94, 2026-04-22)
[HIGH] Before pushing HubL email template changes to HubSpot, iterate locally against _previews/*.html. HubSpot round-trips are slow and obscure layout cause-and-effect. If a preview file exists but doesn't mirror HubSpot's dnd_area wrapping (<td class="dnd-section"> → <td class="dnd-column"> → <td class="dnd-module">), make it faithful before debugging layout issues. (Session 94, 2026-04-22)
[HIGH] Wrap images inside email <td>s in a zero-whitespace table (<td style="padding:0; line-height:0; font-size:0;">) when they need to hug the left edge. Plain <a><img></a> inside a <td> picks up a leading space from surrounding HTML whitespace in some email clients, offsetting the image right of other left-aligned siblings. (Session 95, 2026-04-22)
[HIGH] When a user flags an email as "shifted" or "off," identify the specific element before fixing. "Shifted right" can mean viewport-level centering (usually a client/editor-preview quirk, not a bug) or element-level misalignment between static and dnd sections (the real bug). Ask which, don't guess — the wrong assumption burns test-send round-trips. (Session 95, 2026-04-22)
[MEDIUM] Pre-placed {% dnd_module %} content in an email template is wrapped by HubSpot's editor with different default styles than modules the marketer drags in at runtime. If pre-placed content renders at a different width than dragged content, try hs_wrapper_css={'padding':'0'} on the {% dnd_module %} or check whether the {% dnd_area %} needs full_width=False to stay inside its parent container's max-width. (Session 94, 2026-04-22)
[HIGH] HubSpot's Opted out of email: [subscription name] property is null by default (tri-state model: Subscribed / Unsubscribed / Not Specified). Active-list filters for "subscribers" must use is none of Yes AND check the "Include records where property is empty" box, otherwise never-unsubscribed contacts are excluded from the list. (Session 99, 2026-04-23)
[HIGH] HubSpot's email send engine auto-filters recipients by the Subscription type field on the email itself. List-level opt-in filters are redundant — the list defines the candidate pool, the Subscription type field is the actual gate. Always set the Subscription type correctly; it determines which unsubscribe link the recipient sees and which subscription gets decremented on unsubscribe. Wrong type = unsubscribes hit the wrong list, compliance + trust risk. (Session 99, 2026-04-23)
[MEDIUM] CTA card headlines work better as imperatives that pair with the button ("See X in action" + "Book a demo") than as noun phrases ("X in action"). Flow: kicker poses the problem → imperative headline points to the solution → body proves it → button takes action. Avoid echo between kicker/headline/body openers ("See how X..." right after "See X in action" is a dead giveaway). (Session 99, 2026-04-23)