{####################################
HubSpot Button Module
#####################################
This module is provided as an easy
to implement option for users.
This module references HubL that is
only compatible with the Drag & Drop
Email editor and may not work across
the HubSpot platform.
#-----------------------------------#}
{% set destination = module.destination %}
{% if module.link_to == 'email_address' %}
{% set destination = 'mailto:' + module.email_address %}
{% endif %}
{% if module.link_to == 'subscription' %}
{% if module.subscription_type == 'subscription_preferences' %}
{% set destination = unsubscribe_link %}
{% endif %}
{% if module.subscription_type == 'subscription_confirmation' %}
{% set destination = subscription_confirmation_url %}
{% endif %}
{% if module.subscription_type == 'unsubscribe_all' %}
{% set destination = unsubscribe_link_all %}
{% endif %}
{% if module.subscription_type == 'view_webpage' %}
{% set destination = view_as_page_url %}
{% endif %}
{% endif %}
{% if module.link_to == 'file' %}
{% set destination = module.file %}
{% endif %}
{% if module.link_to == 'page' %}
{% if page_by_id(module.page_field) is defined %}
{% set selectedPage = page_by_id(module.page_field) %}
{% else %}
{% set selectedPage = blog_post_by_id(module.page_field) %}
{% endif %}
{% set destination = selectedPage.absolute_url %}
{% endif %}
{% if module.link_to == 'cta' && module.cta_field && module.cta_field != 'null' %}
|
{% cta guid='{{ module.cta_field }}' embed_code_type='image_email' %}
{% else %}
|
{% endif %}
|
|