Cloned subscription preferences template won't publish – email_subscriptions module error

I’m trying to customise the default subscription preferences page and running into a publish error I can’t resolve.

What I did:

Followed HubSpot’s recommended method: Settings → Marketing → Email → Subscriptions → Actions → Edit → Clone template. Created a clean clone with no edits.

Even on the fresh, unedited clone, as soon as I make any change and hit Publish I get the following errors:

1. The source doesn’t contain the required module email_subscriptions

2. Missing template /system-base.html (line 12: `{% extends “../system-base.html” %}`)

We’ve ruled out

- This isn’t caused by my edits – the clean clone throws the same errors

- The path on line 23 is `path=“@hubspot/email_subscriptions”` which matches the original read-only template exactly

- The original template structure and the clone are identical

Portal details:

EU1 portal. HubSpot AI support has suggested the same cloning steps twice – same result each time.

Has anyone experienced this with system page templates? Is there a known fix or is this a portal-level bug that needs HubSpot support to resolve directly?

Hey @lucybrayOdevo,

if you have cloned the template to your (child) theme, you need to change the {% extends “../system-base.html” %} to the file which contains your layout.
Most times it’s called base.html or something. Just look at your other templates which should have an {% extends %} tag and modify the path in the pref-center template accordingly.

Example file/folder structure:

  • theme
    • css
    • modules
    • templates
      • layouts
        • base.html
      • system
        • custom_preference-center.html ← your cloned template
        • preference-center.html ← default/old one
    • fields.json
    • theme.json

In this case the extends tag should look like this

{% extends "../layouts/base.html" %}

or

{% extends "./templates/layouts/base.html" %}

In case you don’t want to use the extends tag, you need to copy the whole content of the base.html into your custom template and put the required pref-center content (subscription module) into it.

Important note: The reason why HubSpot tells you that the extends tag is missing is because of the {{ standard_header_includes }} and {{ standard_footer_includes }} which are required in every template. Therefore the easiest way to accomplish this is to extend the base and call it a day :slightly_smiling_face:

About the missing module - there are two options I can think of.

  1. The extends tag overrides everything and HS mistakenly fires this error
  2. You might have not closed the module_block somewhere

The default module_block is located in @hubspot/cmsdefaultpages/templates/system/email-subscription-preferences.html and looks like this:

{% module_block module "email_subscription_preferences"
 path="@hubspot/email_subscriptions",
 extra_classes="form-wrapper form-wrapper--subscription-preferences",
 email_heading_level="p",
 language_dropdown_label={{ template_translations.subscription_preferences_language_input_label.message }},
 resubscribe_button_text={{ template_translations.subscription_preferences_resubscribe_button_text.message }},
 subheader_text="",
 unsubscribe_all_unsubbed_text={{ template_translations.subscription_preferences_resubscribe_text.message }},
 button_text={{ template_translations.subscription_preferences_button_text.message }},
 header="",
 unsubscribe_all_option={{ template_translations.subscription_preferences_unsub_all_option.message }},
 unsubscribe_all_text=""
 %}
 {% module_attribute "unsubscribe_single_text" %}
 {% if business_unit().name %}
 {{ template_translations.subscription_preferences_single_text_business_unit.message }}
 {% else %}
 {{ template_translations.subscription_preferences_single_text.message }}
 {% endif %}
 {% end_module_attribute %}
 {% end_module_block %}

Unless you’re working with business units or translations, you can reduce this code drastically to something like this:

{% module "email_subscription_preferences" path="@hubspot/email_subscriptions" %}

^ this is the bare minimum of this module

If you’re working with multi-languages/translations, I’d follow the example setup of the cmsdefaultpages setup and do something like

{% module "email_subscription_preferences" 
 path="@hubspot/email_subscriptions"
 language_dropdown_label={{ template_translations.subscription_preferences_language_input_label.message }},
 resubscribe_button_text={{ template_translations.subscription_preferences_resubscribe_button_text.message }},
 subheader_text="",
 unsubscribe_all_unsubbed_text={{ template_translations.subscription_preferences_resubscribe_text.message }},
 button_text={{ template_translations.subscription_preferences_button_text.message }},
 header="",
 unsubscribe_all_option={{ template_translations.subscription_preferences_unsub_all_option.message }},
 unsubscribe_all_text="" %}

The corresponding language setting can be found in the system-base.html file

{% set template_translations = load_translations("./_locales", html_lang, "en") %}

It’s loading the corresponding translation JSONs from the _locales folder in the cmsdefaultpages folder structure.

Hope this helps

best,

Anton

Thank you! This was incredibly helpful and provided me a solution.