2

I am using the Interactive Email Form feature to allow submitting user data straight from the inbox and enable design configuration by non-technical Marketing people. I would like to enable a way to hide the form based on a condition (if a row for this subscriber exists in a DE). Sends of this Email are not done from Journey Builder and creating two versions of the Email is not a preferred approach.

I've tried the following methods:

  1. Embedding the Email Form block in the ContentBlockByID function - this breaks the form block, displaying only the fallback content block even in clients where the form block itself has worked before.
  2. 'Wrapping' (putting one snippet before and one after the block) the form block with code snippets like

%%[ IF 1 == 2 THEN ]%%

and

%%[ ENDIF ]%%

This resulted in an AMPScript warning of the IF condition not being properly closed - "An IF statement is not closed with the required ENDIF statement. ClientID: 100027770 JobID: 0 EmailID: 0 Index: 198 Statement: IF 1 == 2 THEN]%%".

  1. Hiding with CSS (form { display:none !important; }, fieldset { display:none !important; } in a code snippet or an HTML block) - this seemed like it worked in the preview, but when executing the test send the emails in the Gmail inbox still have a form visible.

Is there any workaround for this? Allowing to conditionally show the block seems like a crucial feature.

1
  • The surrounding AMPscript in #2 needs to be added to the template code and then that template should be used to build the email.
    – Matt S
    Commented Oct 19, 2022 at 14:51

2 Answers 2

1

Workaround found: copy the part responsible for the Form Block rendering from Code View and paste it into a new Dynamic Content Block, there wrap it with AMPscript condition. Will break if values (answers, button text etc) are modified in the original Interactive Form Block but styling should still be modifiable.

0

Conditional AMPscript logic can be used in the template to surround the slot(s).

%%[ IF 1 == 2 THEN ]%%
<div data-type="slot" data-key="interactivecontent" data-label="Interactive Content Section"></div>
%%[ ENDIF ]%%
2
  • This is throwing up all kinds of AMPscript errors for me when previewing. Have you tried to test it? Commented Jun 10, 2022 at 9:16
  • This should be added to the Content Builder template that's being used, not within a block in the email. When added within the template code, I do not see any errors.
    – Matt S
    Commented Oct 19, 2022 at 14:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .