cancel
Showing results for 
Search instead for 
Did you mean: 

Are conditional blocks supported?

Visitor

Are conditional blocks supported?

Does the e-mail templating support conditionally including a section based on custom variables?

 

3 REPLIES 3
CTCT Employee

Re: Are conditional blocks supported?

Hi,

 

We don't have a feature like that built into our email editor.  However, if you're creating an email through the API, you could write logic into your code on whether or not to include a section of the email, get the entire html code of the email afterward, html encode it, and send it to us when you create the email through the API.

 

Best Regards,

Shannon W.

API Support Specialist

Visitor

Re: Are conditional blocks supported?

ok, thanks. 

 

Doing some more reading, it does appear as if the following should be possible:

 

         Include a custom block using "IfPropertyExists" for a custom field (e.g. Custom Text 1)

         then if the Custom Text 1 is set, the block should show up, in theory.

 

Do you know anyone who has done that successfully?

 

Also, is the limit of custom fields set at 15 strict or can it be extended?

 

Thanks!

CTCT Employee

Re: Are conditional blocks supported?

Hi,

 

*Edited*

 

You can use the if property exists XML supported by our advanced editor.  I think the clearest way to describe how to use this is this snippet from Our Advanced User guide here (page 29).

 

<IfPropertyExists name=”letter.article.toc”>
..
<Property name=”letter.article.toc”
<!-- Display the TOC title -->
title=”Table of Contents Headline”
type=”single”
font=”TOCHeadlineText”>
in this issue
</Property></td></tr>
</IfPropertyExists>

 If you include a Property tag in your XHTML with the same name as what you put in the IfPropertyExists tag, the contents inside IfPropertyExists will display.

 

Custom fields are limited to 50 characters each, and that limit doesn't change.  See the bottom of this page for all of the contact detail fields you can utilize, along with the allowed length for each.

 

Best Regards,

Shannon W.

API Support Specialist