Skip to content

Creating HubSpot Emails

HubSpot emails can be created using either custom-coded templates or the drag & drop email editor. Depending on the project requirements, developers may create templates using HTML + HubL and reusable modules.

Creating an email template is very similar to creating a page template.

  1. Navigate to Marketing > Files and Templates > Design Tools
  2. Click File > New File
  3. Select HTML + HubL
  4. Choose Email as the template type
  5. Write the email structure using HTML and HubL

Inside the template you can:

  • Write standard HTML markup
  • Include custom modules
  • Add dynamic content using HubL

HubSpot requires certain company information to be included in marketing emails for compliance reasons.

Common fields include:

  • site_settings.company_name
  • site_settings.company_street_address_1
  • site_settings.company_city
  • site_settings.company_state
  • site_settings.company_zip
  • site_settings.company_country

Emails must also include an unsubscribe option:

  • unsubscribe_link
  • unsubscribe_link_all
  • unsubscribe_section

Additional HubL variables that can be useful in email templates include:

  • view_as_page_url – Displays a “View in browser” link for recipients who cannot properly view the email.
  • subscription_name
  • site_settings.company_street_address_2

Email templates can also include custom modules, similar to landing pages.

Modules allow developers to create reusable components such as:

  • headers
  • content blocks
  • call-to-action sections
  • footers

These modules can then be configured by marketers directly in the email editor.

Email styling has stricter limitations than normal web pages.

To ensure compatibility across email clients:

  • All styles should be written inline. Many email clients strip or ignore <style> tags, so inline styles ensure consistent rendering.
  • Avoid complex CSS
  • Avoid unsupported properties used in web layouts

This ensures better rendering across email clients such as Gmail, Outlook, and Apple Mail.

Emails can also be created using HubSpot’s drag & drop email builder.

  1. Navigate to Marketing > Email
  2. Click Create email
  3. Select a template
  4. Use the visual editor to add modules and edit content

Knowledge Check

Test your understanding of this section

Loading questions...