APIs & Integrations

Moadh
Participant | Partenaire solutions Platinum
Participant | Partenaire solutions Platinum

Using Hubl variables as parameters in hubl functions

 **{% text "id_form" label='Id formulaire contact (1 pour chaque langue)', value='3f2b3ff8-693b-43b4-845c-b3b200908472', export_to_template_context=True %}**

{% for row in hubdb_table_rows .... %}

{% widget_block form "form_contact_reseau" form_follow_ups_follow_up_type='', response_redirect_id=306590405, form_to_use='**widget_data.id_form.value**', title="" , notifications_are_overridden=True, sfdc_campaign='', response_message='Thanks for submitting the form.', response_response_type='redirect', response_redirect_url='', overrideable=True, gotowebinar_webinar_key='', response_redirect_name='Homepage (http://www.hubspot.com/)', label='Form', response={message='Thank you for submitting the form.', redirect_url=''}  %}

                            {% widget_attribute "notifications_override_email_addresses" is_json=True %}["**{{ row.email }}**"]{% end_widget_attribute %}

 {% end_widget_block %}

{% endfor %}

How to integrate the two variables hubl in this function to be able to vary the notification email and the form.

I have a supplier table that returns an email, and I have 5 different form (compared to the language). I want to display a form according to the defined id_form parameter and that the form returns an email notification to the vendors email address in the table.

Can you help me, Thank you so much for your involvement.

cordially

0 Votes
3 Réponses
Moadh
Participant | Partenaire solutions Platinum
Participant | Partenaire solutions Platinum

Using Hubl variables as parameters in hubl functions

                {% widget_block form "form_contact_reseau" form_to_use='{{widget_data.id_form.value}}', form_follow_ups_follow_up_type='simple', simple_email_for_live_id='4976787772', simple_email_for_buffer_id='4976787772', follow_up_type_simple='true'  %}
                    {% for row in hubdb_table_rows(602637, "&hs_id__eq="+request.query_dict.id)  %}
                        {% widget_attribute "notifications_override_email_addresses" %}{{ row.email }},{{ row.email2 }}{% end_widget_attribute %}
                    {% endfor %}
                {% end_widget_block %}

That worked, after nothing. The tracking mail works but not the notification for my two contact.

0 Votes
Moadh
Participant | Partenaire solutions Platinum
Participant | Partenaire solutions Platinum

Using Hubl variables as parameters in hubl functions

Super it works!
I want to integrate a follow-up mail but I do not arrive in this form. Will you help me again?

0 Votes
tjoyce
Expert reconnu | Partenaire solutions Elite
Expert reconnu | Partenaire solutions Elite

Using Hubl variables as parameters in hubl functions

A couple things:

  1. you shouldn’t set your widget_block inside the for loop… {% widget_block form "form_contact_reseau"... since the HUBL module will be attempting to set the same ID form_contact_reseau for each widget block which would be a duplicate.

  2. I just tested this code so it should work… if you remove is_json=“true” - you can just pass a string with comma separated values

{% text "id_form" label='Id formulaire contact (1 pour chaque langue)', value='3f2b3ff8-693b-43b4-845c-b3b200908472', export_to_template_context=True %}
{% set loopy = ['Content', 'Social'] %}
   
{% widget_block form "form_contact_reseau" form_to_use='{{widget_data.id_form.value}}'  %}
{% for row in loopy %}
    {% set email1 = "email1@email.com" %}
    {% set email2 = "email2@email.com" %}
    {% set emailaddycompiledstring = '{{email1}}, {{email2}}' %}
    {% widget_attribute "notifications_override_email_addresses" %}{{emailaddycompiledstring}}{% end_widget_attribute %}

{% endfor %}
{% end_widget_block %}
0 Votes