We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
Dec 12, 2018 9:46 AM
I created an employees page using HubDB and a custom module with a for loop to create the listing. The custom module has a field for the form but I customized it with the widget_block so I could edit the notifications_override_email_addresses. It is set up so that each employee gets a form and I would like it to email said employee when their form is filled out.
Now, the code works just fine when I use a static email in it, but when I try to use the row.email it does not send the notification email. I did use the row.hs_id for the form id to make sure each form had a unique id, so it is pulling information from the database into the forms creation. I also triple checked that row.email and its entry in the database where all spelled correctly. If anyone has some insight on this I would appreciate it. my code is below.
{% widget_block form row.hs_id, form_follow_ups_follow_up_type='', response_redirect_id=module.form_field.redirect_id, form_to_use='{{ module.form_field.form_id }}', title='', notifications_are_overridden=True, sfdc_campaign='', response_message='{{ module.form_field.message }}', response_response_type='{{ module.form_field.response_type }}', response_redirect_url='{{module.form_field.redirect_url}}', overrideable=True, gotowebinar_webinar_key='', response_redirect_name='Homepage (http://www.hubspot.com/)', label='Form', response={message='{ module.form_field.message }}', redirect_url='{{module.form_field.redirect_url}}'} %}
{% widget_attribute "notifications_override_email_addresses" is_json=True %}["{{ row.email }}"]{% end_widget_attribute %}
{% end_widget_block %}
I would like to add that I also tried to remove the json=True and add only the email as suggested in this post
A couple things: 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. 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-b3b200908…
{% set send_email= 'email@email.com' %}
{% widget_block form 'fop', form_follow_ups_follow_up_type='', response_redirect_id=module.form_field.redirect_id, form_to_use='e75096de-a2f8-4683-bdc7-78368942be02', title='', notifications_are_overridden=True, response_message='thanks', overrideable=True, label='Form'} %}
{% widget_attribute "notifications_override_email_addresses" is_json=True %}["{{ send_email }}"]{% end_widget_attribute %}
{% end_widget_block %}
Solved! Go to Solution.
Dec 12, 2018 3:09 PM
To anyone who finds this and has a similar problem, I found a solution. While I cant seem to put hubl in the widget_attribute I can turn the whole thing into a token and place that inside the widget_block, like this;
{% set email_attribute = '{% widget_attribute "notifications_override_email_addresses" is_json=True %}["'~ row.email ~'"]{% end_widget_attribute %}' %}
{% widget_block form row.hs_id, form_follow_ups_follow_up_type='', response_redirect_id=module.form_field.redirect_id, form_to_use='{{ module.form_field.form_id }}', title='{{ row.name }}', notifications_are_overridden=True, response_message='{{ module.form_field.message }}', response_response_type='{{ module.form_field.response_type }}', response_redirect_url='{{module.form_field.redirect_url}}', overrideable=True, label='Form', response={message='{ module.form_field.message }}', redirect_url='{{module.form_field.redirect_url}}'} %}
{{ email_attribute }}
{% end_widget_block %}
Dec 12, 2018 3:09 PM
To anyone who finds this and has a similar problem, I found a solution. While I cant seem to put hubl in the widget_attribute I can turn the whole thing into a token and place that inside the widget_block, like this;
{% set email_attribute = '{% widget_attribute "notifications_override_email_addresses" is_json=True %}["'~ row.email ~'"]{% end_widget_attribute %}' %}
{% widget_block form row.hs_id, form_follow_ups_follow_up_type='', response_redirect_id=module.form_field.redirect_id, form_to_use='{{ module.form_field.form_id }}', title='{{ row.name }}', notifications_are_overridden=True, response_message='{{ module.form_field.message }}', response_response_type='{{ module.form_field.response_type }}', response_redirect_url='{{module.form_field.redirect_url}}', overrideable=True, label='Form', response={message='{ module.form_field.message }}', redirect_url='{{module.form_field.redirect_url}}'} %}
{{ email_attribute }}
{% end_widget_block %}