- Unsubscribe
<a href="{{ unsubscribe_link }}">Manage preferences or unsubscribe</a> (required); {{ unsubscribe_link_all }} unsubscribes from every type- First name
{{ contact.firstname }}(HubL)- With a fallback
{{ contact.firstname|default("there", true) }}- View in browser
{% if content.create_page %}<a href="{{ view_as_page_url }}">View as web page</a>{% endif %}- Preferences
{{ unsubscribe_link }}- Postal address
{{ site_settings.company_name }}, {{ site_settings.company_street_address_1 }}, {{ site_settings.company_city }}, {{ site_settings.company_state }}
The HubSpot Marketing Hub unsubscribe link
Put this in the footer of every marketing email you code for HubSpot Marketing Hub:
<a href="{{ unsubscribe_link }}">Manage preferences or unsubscribe</a> (required); {{ unsubscribe_link_all }} unsubscribes from every type
- Required to send: unsubscribe_link plus site_settings company_name, street_address_1, city and state.
The law in most countries also wants the unsubscribe to be easy to find and free to use: see the email rules by country.
Personalisation in HubSpot Marketing Hub: first name with a fallback
HubSpot Marketing Hub uses HubL. A first name on its own:
{{ contact.firstname }}
With a fallback, so an empty field never shows a blank or a raw tag:
{{ contact.firstname|default("there", true) }}
Showing something only to some people (an if / else):
{% if contact.firstname %}Hi {{ contact.firstname }}{% else %}Hi there{% endif %}
View in browser, preferences and address tags
- View in browser:
{% if content.create_page %}<a href="{{ view_as_page_url }}">View as web page</a>{% endif %} - Preferences:
{{ unsubscribe_link }} - Postal address:
{{ site_settings.company_name }}, {{ site_settings.company_street_address_1 }}, {{ site_settings.company_city }}, {{ site_settings.company_state }}
Making a coded template editable in HubSpot Marketing Hub
A coded HTML + HubL template (annotation templateType: email). Content people edit per email is declared with module tags, such as content_attribute for the body or default email modules.
{% content_attribute "email_body" %}<p>Hi {{ contact.firstname }},</p>{% end_content_attribute %}
{% module "cta" path="@hubspot/email_cta" %}
Getting your HTML into HubSpot Marketing Hub
Create an HTML + HubL file in the design manager with the templateType: email annotation; it then appears only when choosing a template for a new email.
Limits worth knowing
- Rules in one <style id="hs-inline-css"> are inlined; only one such tag per coded template.
- Media queries cannot be inlined and must go in a separate <style>.
- Use the email versions of default modules (e.g. @hubspot/email_cta), not the web ones.
What HubSpot Marketing Hub calls things
Every platform has its own words for the same ideas. HubSpot Marketing Hub's, in plain English:
| The idea | HubSpot Marketing Hub calls it | Worth knowing |
|---|---|---|
| One-off send | Regular email | A marketing email you write once and send or schedule to a chosen segment. |
| Automated journey | Workflow | An automation enrolling records on trigger criteria, then running branching, timed actions. Not the same as a Sequence, which is a one-to-one sales tool. |
| Trigger / entry | Enrollment trigger | The criteria that automatically enrol a record into a workflow. |
| Static group | Static segment | A frozen group captured when you saved it; members are added or removed by hand. Renamed from static list, URLs and older screens still say list. |
| Dynamic group | Active segment | A self-updating group; records join and leave as they match the filters. Previously an active list, the two names mean the same thing. |
| Customer record | Contact | The record for one person in the CRM: properties, activities and associations. |
| Custom field | Custom property | A field you create on an object to store data HubSpot doesn’t include by default. |
| Behavioural event | Custom behavioral event | A named action you define and send to HubSpot, such as a video watched. Enterprise only. HubSpot’s own tracked interactions are just “events”, different thing. |
| Reusable block | Module | A reusable content component; global modules update everywhere at once. A Snippet is a sales tool for one-to-one emails, not an email block. |
| Template | Email template | A saved layout deciding the structure and editable areas of new marketing emails. A sales template is a different object, saved copy for one-to-one emails. |
| Personalisation language | HubL | HubSpot’s templating language for logic, loops and dynamic content. |
| Fallback value | Default value | Text shown when a personalization token has no value, set when inserting the token. |
| A/B test | A/B test | A split of one email into two versions sent to halves of the audience. Adaptive testing is a separate, higher-tier feature supporting more variations. |
| Suppression | Suppression list | A segment used to stop contacts enrolling in a workflow; emails use excluded segments. Only blocks workflow enrolment, not an account-wide do-not-email list. |
| Frequency capping | Email frequency safeguard | A setting limiting how many marketing emails one contact receives in a period. Marketing Hub Enterprise only, lower tiers have no equivalent. |
| Transactional | Transactional email | Receipts and account notices ignoring subscription status, with no unsubscribe footer. Needs the paid Transactional Email add-on, you can’t just flag a marketing email. |
| Preference centre | Subscription preferences page | The hosted page where contacts tick which subscription types they want. |
| Send-time optimisation | Send time optimization | Sends at each contact’s best time, calculated from ninety days of opens and clicks. Per-contact optimisation is Enterprise; lower tiers get one suggested send time. |
| Reporting | Dashboard | A single screen combining several reports. |
| Imported data table | HubDB | A spreadsheet-like table of rows and columns you can query and display on pages. Not part of the CRM, HubDB rows are not contacts and cannot be emailed. |
| API-triggered send | Single-send API | An API call sending a saved transactional email to one recipient. The workflow Webhook action pushes data out, it does not trigger a send in. |
| Draft vs live | Draft / Published (workflows: ON / OFF) | Content stays draft until published; workflows only act once switched ON. |
What we couldn't confirm
We only list what HubSpot Marketing Hub's documentation says. These points weren't clear from it, so test them in your account:
- Whether dnd_area (drag-and-drop areas) can be used in coded email templates; the docs only describe it for pages.
- No separate "manage preferences" variable: unsubscribe_link itself opens the preferences page.
Questions
What is the unsubscribe tag in HubSpot Marketing Hub?
{{ unsubscribe_link }} (required); {{ unsubscribe_link_all }} unsubscribes from every type. Required to send: unsubscribe_link plus site_settings company_name, street_address_1, city and state.
How do I add a first name with a fallback in HubSpot Marketing Hub?
HubSpot Marketing Hub uses HubL. A first name is {{ contact.firstname }}, and with a fallback: {{ contact.firstname|default("there", true) }}
How do I add a view-in-browser link in HubSpot Marketing Hub?
Use {% if content.create_page %}{{ view_as_page_url }}{% endif %}.
How do I get a custom HTML email into HubSpot Marketing Hub?
Create an HTML + HubL file in the design manager with the templateType: email annotation; it then appears only when choosing a template for a new email.
Sources
- developers.hubspot.com/docs/cms/reference/hubl/variables
- developers.hubspot.com/docs/cms/reference/hubl/filters
- developers.hubspot.com/docs/cms/start-building/building-blocks/templates/email-template-markup
- developers.hubspot.com/docs/cms/start-building/building-blocks/templates/overview
- developers.hubspot.com/docs/cms/start-building/building-blocks/modules/default-email-modules
- knowledge.hubspot.com/get-started/hubspot-glossary (terms)
Checked by Mailfois against HubSpot Marketing Hub's documentation on 27 October 2026. Platforms rename things often: spotted something out of date? Email [email protected].
Other platforms
Mailchimp · Klaviyo · Salesforce Marketing Cloud Engagement · Braze · Adobe Marketo Engage · Bloomreach Engagement · Brevo · Constant Contact · Campaign Monitor · Dotdigital · Iterable · Resend