It could have 1 to 12 different products based on the customer information.
The way I have it currently setup is like below, but my problem is when a customer only has say 1 product, there is a huge gap in the design allowing space for the other 11 potential products.
How can I fix this in either HTML or design to auto adjust the space needed and not show the empty space.
%%gph4_prod1%%
%%gph4_prod2%%
%%gph4_prod3%%
%%gph4_prod4%%
%%gph4_prod5%%
%%gph4_prod6%%
%%gph4_prod7%%
%%gph4_prod8%%
%%gph4_prod9%%
%%gph4_prod10%%
%%gph4_prod11%%
%%gph4_prod12%%
4 answers
Hi,
I have fixed this issue using AMPScript in my email. Use AMPScript if else to display/hide HTML code based on variable values. Something like below.
%%[ set @p1 = AttributeValue("Product 1") if not empty(@p1) then ]%%
<h1> HTML CODE 1</h1>
%%[ endif ]%%
%%[ set @p2 = AttributeValue("Product 2") if not empty(@p2) then ]%%
<h1> HTML CODE 2</h1>
%%[ endif ]%%