【问题标题】:HuBL: How to check what lists a contact is part of by contact ID?HuBL:如何通过联系人 ID 检查联系人属于哪些列表?
【发布时间】:2020-07-31 11:17:23
【问题描述】:

如果用户是 HubSpot 列表的一部分,我会尝试显示特定内容。

伪:

If contact_id is part_of_this_list then do this

目前正在从查询字符串中获取联系人 ID。我正在尝试检查用户是否在所述列表中,但它不起作用。

方法:

{% set id_querystring = request.query_dict.id %}
{% set registration_list_id = "6136" %} <!-- id of the list I'm checking -->

{% if id_querystring in registration_list_id %}
 contact is part of list
{% else %}
 contact is not part of list
{% endif %}

【问题讨论】:

  • 尝试在request.query_dict.id 上使用dump(),以便我们了解该变量结构并将其发布在您的问题中。

标签: twig hubspot hubl


【解决方案1】:

我使用这个代码:

{% set list_variable = request_contact.list_memberships|pprint %}
{% if "id of the list you are checking" in list_variable %} ← without the quotes

yes, you are in the list

{%else%}

No, you are not in the list

{%endif%}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-06
    • 2023-03-23
    相关资源
    最近更新 更多