salesforceexacttarget

Collapsable empty rows in ExactTarget emails... How?


I'm trying to develop an email where the empty content areas would collapse if there is no content within them. I have tried putting the tag within a zeroed out table

<table style="padding:0; margin: 0; font-size: 0; line-height:0; (etc...)>
    <tr style="padding:0; margin: 0; font-size: 0; line-height:0; (etc...)>
        <td style="padding:0; margin: 0; font-size: 0; line-height:0; (etc...)>
           <custom type="content" name="contentArea">
        </td>
     </tr>
</table> 

However, this causes the empty table to have a huge gap in Outlook 2013, and 1px gaps in older Outlook clients.

I have also tried putting content tags only (in the template), and then paste in the HTML code as content areas (in the emails). This method solves the spacing issue, however I can't add INNER content areas (for example in this email I need to have 2 editable columns)

TL;DR: How do I add rows that collapse gracefully when there's no content inside them? Is it possible to nest tags inside tags?

Please let me know if I need to clarify anything, I really appreciate the help!

Cheers!


Solution

  • Using ampscript IF/THEN logic seems the way to go here. Assuming that your content is coming from some source external to the email (a data extension or other source of syndication), you could check to see if the content exists, and not display the relevant or if it does not.

    %%[SET @rows = lookuprows("MyDataSource","ID",@id) 
    
    if rowcount(@rows) > 0 THEN ]%%
    
    //put relevant html here 
    
    %%[ENDIF]%%